Giter Club home page Giter Club logo

Comments (5)

kevin-schmitt avatar kevin-schmitt commented on August 16, 2024 1

Hi,
I take this issue, can you assign to me please @villfa ?
Thanks :)

from codor.

villfa avatar villfa commented on August 16, 2024 1

To run a specific test file, use this command:

vendor/bin/simple-phpunit --debug tests/Sniffs/Files/ReturnNullSniffTest.php

To reproduce the problem you have to write a new test.
You could add a new method by duplicating the existing one and then modifying it as you need.
You can also use the code snippet from my previous comment by creating a new file in this folder: https://github.com/bmitch/Codor/tree/be85e18/tests/Sniffs/Files/Assets/ReturnNullSniff

from codor.

villfa avatar villfa commented on August 16, 2024

This problem is not specific to Laravel.
Here an example to reproduce it:

<?php
class Foo
{
    public function filter(array $items): array
    {
        return array_filter($items, function ($item) {
            return $item !== null;
        });
    }
}

And the error message:

---------------------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------
 7 | ERROR | Return null value found.
   |       | (Codor.Files.ReturnNull.Codor\Sniffs\Files\ReturnNullSniff)
 7 | ERROR | Return null value found.
   |       | (Codor.Files.ReturnNull.Codor\Sniffs\Files\ReturnNullSniff)
---------------------------------------------------------------------------------------------------

According this message the problem comes from ReturnNullSniff.

from codor.

kevin-schmitt avatar kevin-schmitt commented on August 16, 2024

Hello,

Question please when i run test to try to reproduce problem


 composer test tests/Sniffs/Files/ReturnNullSniffTest.php 
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------
 23 | ERROR | Method name
    |       | "ReturnNullSniffTest::it_detects_functions_that_return_null"
    |       | is not in camel caps format
    |       | (PSR1.Methods.CamelCapsMethodName.NotCamelCaps)
----------------------------------------------------------------------

How to test and reproduce problem in local please?

Thanks

from codor.

villfa avatar villfa commented on August 16, 2024

Fixed with Codor 1.2.2

from codor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.