src/pusher/abstract-pusher.php
The class Abstract_Pusher is not named in CamelCase. Open
Open
abstract class Abstract_Pusher implements Pusher_Interface {
/**
* Cargo instance.
*
- Read upRead up
- Exclude checks
CamelCaseClassName
Since: 0.2
It is considered best practice to use the CamelCase notation to name classes.
Example
class class_name {
}
Source
Expected 0 spaces between argument "$cargo" and closing bracket; 1 found Open
Open
public function __construct( Cargo $cargo ) {
- Exclude checks
Expected 0 spaces between argument "$data" and closing bracket; 1 found Open
Open
protected function to_json( $data ) {
- Exclude checks
Expected 0 spaces between opening bracket and argument "$data"; 1 found Open
Open
protected function to_json( $data ) {
- Exclude checks
Expected 0 spaces between argument "$error" and closing bracket; 1 found Open
Open
protected function save( $data, $error = '' ) {
- Exclude checks
Method name "Abstract_Pusher::to_json" is not in camel caps format Open
Open
protected function to_json( $data ) {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
if ( $data instanceof Content_Interface ) {
- Exclude checks
Opening brace of a class must be on the line after the definition Open
Open
abstract class Abstract_Pusher implements Pusher_Interface {
- Exclude checks
Expected 0 spaces between opening bracket and type hint "Cargo"; 1 found Open
Open
public function __construct( Cargo $cargo ) {
- Exclude checks
Expected 0 spaces between opening bracket and argument "$data"; 1 found Open
Open
protected function save( $data, $error = '' ) {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
if ( empty( $data ) ) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* @var \Isotop\Cargo\Cargo
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$data = is_string( $data ) ? $data : wp_json_encode( $data );
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$data = $this->to_json( $data );
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
protected $cargo;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* Save data.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
return;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* @param \Isotop\Cargo\Cargo $cargo
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$this->cargo = $cargo;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
return $data->to_json() ?: '';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
if ( $data instanceof Content_Interface ) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* Cargo instance.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* @param mixed $data
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
}
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* Convert data to JSON or empty string.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* @param mixed $error
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
protected function save( $data, $error = '' ) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* @return string
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
if ( empty( $data ) ) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$error = $this->to_json( $error );
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
protected function to_json( $data ) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$data = is_string( $data ) ? $data : '';
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
return $data;
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
$this->cargo->make( 'database' )->save( $data, $error );
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* Pusher Constructor.
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*/
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
public function __construct( Cargo $cargo ) {
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
* @param mixed $data
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
/**
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
*
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
$data = is_string( $data ) ? $data : wp_json_encode( $data );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
$data = $this->to_json( $data );
- Exclude checks
Expected 0 spaces after opening bracket; 1 found Open
Open
if ( empty( $data ) ) {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
$this->cargo->make( 'database' )->save( $data, $error );
- Exclude checks
Class name "Abstract_Pusher" is not in camel caps format Open
Open
abstract class Abstract_Pusher implements Pusher_Interface {
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
$data = is_string( $data ) ? $data : '';
- Exclude checks
Opening brace should be on a new line Open
Open
public function __construct( Cargo $cargo ) {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
$data = is_string( $data ) ? $data : wp_json_encode( $data );
- Exclude checks
Expected 0 spaces after opening bracket; 1 found Open
Open
if ( $data instanceof Content_Interface ) {
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
$data = is_string( $data ) ? $data : wp_json_encode( $data );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
$error = $this->to_json( $error );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
$this->cargo->make( 'database' )->save( $data, $error );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
$data = is_string( $data ) ? $data : wp_json_encode( $data );
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
$error = $this->to_json( $error );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
if ( empty( $data ) ) {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
$data = is_string( $data ) ? $data : '';
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
$data = $this->to_json( $data );
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
if ( empty( $data ) ) {
- Exclude checks
Opening brace should be on a new line Open
Open
protected function save( $data, $error = '' ) {
- Exclude checks
Opening brace should be on a new line Open
Open
protected function to_json( $data ) {
- Exclude checks
Expected 0 spaces before closing bracket; 1 found Open
Open
$this->cargo->make( 'database' )->save( $data, $error );
- Exclude checks
Space after opening parenthesis of function call prohibited Open
Open
$this->cargo->make( 'database' )->save( $data, $error );
- Exclude checks
The method to_json is not named in camelCase. Open
Open
protected function to_json( $data ) {
if ( $data instanceof Content_Interface ) {
return $data->to_json() ?: '';
}
- Read upRead up
- Exclude checks
CamelCaseMethodName
Since: 0.2
It is considered best practice to use the camelCase notation to name methods.
Example
class ClassName {
public function get_name() {
}
}