for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Dallgoot\Yaml;
/**
*
*/
class Compact extends \ArrayIterator implements \JsonSerializable
{
// private static $value;
// public function __construct($argument)
// {
// self::$value = $argument;
// // if ($argument instanceof \Countable && count($argument) > 0) {
// // # it's an array-like
// // } else {
// // //it's an object-like
// // }
// }
//
public function __construct()
parent::__construct([], 1);//1 = Array indices can be accessed as properties in read/write.
}
public function jsonSerialize()
$prop = get_object_vars($this);
if (count($prop) > 0) return $prop;
if (count($this) > 0) return iterator_to_array($this);
public static function wrap($arrayOrObject)
$arrayOrObject
If this is a false-positive, you can also ignore this issue in your code via the ignore-unused annotation
ignore-unused
public static function wrap(/** @scrutinizer ignore-unused */ $arrayOrObject)
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.
return $this;
$this