Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop calling a method static if its not static #872

Closed
wants to merge 2 commits into from
Closed

Stop calling a method static if its not static #872

wants to merge 2 commits into from

Conversation

Jamesking56
Copy link

Fixes #846

@Jamesking56
Copy link
Author

Jamesking56 commented Jan 6, 2020

Same CI failure as master

@mfn
Copy link
Collaborator

mfn commented Jan 7, 2020

Yeah, I'd say the failed tests are unrelated. Not sure why, the tested console command (ModelsCommand) seems to error out only in Laravel 6 and the tests poorly handle that case. Locally it works for me…

@mfn
Copy link
Collaborator

mfn commented Jan 7, 2020

Actually no, this PR seems to break it. This is the exception caught in generateDocs (but unfortunately poorly handled in the tests):

Method Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\CustomDate\Models\CustomDate::whereCreatedAt() does not exist

#0 /laravel-ide-helper/src/Console/ModelsCommand.php(413): ReflectionMethod->__construct(Object(Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\CustomDate\Models\CustomDate), 'whereCreatedAt')
#1 /laravel-ide-helper/src/Console/ModelsCommand.php(220): Barryvdh\LaravelIdeHelper\Console\ModelsCommand->getPropertiesFromTable(Object(Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\CustomDate\Models\CustomDate))
#2 /laravel-ide-helper/src/Console/ModelsCommand.php(118): Barryvdh\LaravelIdeHelper\Console\ModelsCommand->generateDocs(Array, Array)
#3 [internal function]: Barryvdh\LaravelIdeHelper\Console\ModelsCommand->handle()
#4 /laravel-ide-helper/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(32): call_user_func_array(Array, Array)
#5 /laravel-ide-helper/vendor/laravel/framework/src/Illuminate/Container/Util.php(36): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#6 /laravel-ide-helper/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(90): Illuminate\Container\Util::unwrapIfClosure(Object(Closure))
#7 /laravel-ide-helper/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(34): Illuminate\Container\BoundMethod::callBoundMethod(Object(Illuminate\Foundation\Application), Array, Object(Closure))
#8 /laravel-ide-helper/vendor/laravel/framework/src/Illuminate/Container/Container.php(590): Illuminate\Container\BoundMethod::call(Object(Illuminate\Foundation\Application), Array, Array, NULL)
#9 /laravel-ide-helper/vendor/laravel/framework/src/Illuminate/Console/Command.php(202): Illuminate\Container\Container->call(Array)
#10 /laravel-ide-helper/vendor/symfony/console/Command/Command.php(255): Illuminate\Console\Command->execute(Object(Symfony\Component\Console\Input\ArrayInput), Object(Mockery_1_Illuminate_Console_OutputStyle))
#11 /laravel-ide-helper/vendor/laravel/framework/src/Illuminate/Console/Command.php(189): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArrayInput), Object(Mockery_1_Illuminate_Console_OutputStyle))
#12 /laravel-ide-helper/vendor/symfony/console/Tester/CommandTester.php(76): Illuminate\Console\Command->run(Object(Symfony\Component\Console\Input\ArrayInput), Object(Symfony\Component\Console\Output\StreamOutput))
#13 /laravel-ide-helper/tests/TestCase.php(32): Symfony\Component\Console\Tester\CommandTester->execute(Array)
#14 /laravel-ide-helper/tests/Console/ModelsCommand/CustomDate/Test.php(64): Barryvdh\LaravelIdeHelper\Tests\TestCase->runCommand(Object(Barryvdh\LaravelIdeHelper\Console\ModelsCommand), Array)
#15 /laravel-ide-helper/vendor/phpunit/phpunit/src/Framework/TestCase.php(1408): Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\CustomDate\Test->test()
#16 /laravel-ide-helper/vendor/phpunit/phpunit/src/Framework/TestCase.php(1028): PHPUnit\Framework\TestCase->runTest()
#17 /laravel-ide-helper/vendor/phpunit/phpunit/src/Framework/TestResult.php(691): PHPUnit\Framework\TestCase->runBare()
#18 /laravel-ide-helper/vendor/phpunit/phpunit/src/Framework/TestCase.php(756): PHPUnit\Framework\TestResult->run(Object(Barryvdh\LaravelIdeHelper\Tests\Console\ModelsCommand\CustomDate\Test))
#19 /laravel-ide-helper/vendor/phpunit/phpunit/src/Framework/TestSuite.php(597): PHPUnit\Framework\TestCase->run(Object(PHPUnit\Framework\TestResult))
#20 /laravel-ide-helper/vendor/phpunit/phpunit/src/TextUI/TestRunner.php(621): PHPUnit\Framework\TestSuite->run(Object(PHPUnit\Framework\TestResult))
#21 /laravel-ide-helper/vendor/phpunit/phpunit/src/TextUI/Command.php(200): PHPUnit\TextUI\TestRunner->doRun(Object(PHPUnit\Framework\TestSuite), Array, true)
#22 /laravel-ide-helper/vendor/phpunit/phpunit/src/TextUI/Command.php(159): PHPUnit\TextUI\Command->run(Array, true)
#23 /laravel-ide-helper/vendor/phpunit/phpunit/phpunit(61): PHPUnit\TextUI\Command::main()
#24 {main}

@mfn
Copy link
Collaborator

mfn commented Jan 7, 2020

(I'll improve this unexpected error handling later)

@Jamesking56
Copy link
Author

Is this good to merge then or do I need to change something here?

Copy link
Collaborator

@mfn mfn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this good to merge then or do I need to change something here?

IMHO change is fine, but:

Thanks!

@@ -1,15 +0,0 @@
; This file is for unifying the coding style for different editors and IDEs.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Undo the file removal, please

@mfn
Copy link
Collaborator

mfn commented Mar 6, 2020

See also #897 (comment)

@Jamesking56 Jamesking56 closed this by deleting the head repository Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

newQuery() is not static
2 participants