JsonApi/ResourceCollection.php
Remove error control operator '@' on line 54. Open
Open
public static function buildFromArray(array $resources)
{
$resource = @$resources[0];
if (!$resource instanceof EntityResource) {
- Read upRead up
- Exclude checks
ErrorControlOperator
Error suppression should be avoided if possible as it doesn't just suppress the error, that you are trying to stop, but will also suppress errors that you didn't predict would ever occur. Consider changing error_reporting() level and/or setting up your own error handler.
Example
function foo($filePath) {
$file = @fopen($filPath); // hides exceptions
$key = @$array[$notExistingKey]; // assigns null to $key
}
Source http://phpmd.org/rules/cleancode.html#errorcontroloperator
The extends keyword must be on the same line as the class name Open
Open
extends ArrayCollection
- Exclude checks
The closing parenthesis and the opening brace of a multi-line function declaration must be on the same line Open
Open
{
- Exclude checks
The implements keyword must be on the same line as the class name Open
Open
implements ResourceCollectionInterface
- Exclude checks
TRUE, FALSE and NULL must be lowercase; expected "null" but found "NULL" Open
Open
ResourceMetadata $metadata = NULL
- Exclude checks