Skip to content

Commit

Permalink
add phpstan and update code for level 2
Browse files Browse the repository at this point in the history
  • Loading branch information
sagautam5 committed Apr 7, 2024
1 parent 2af2646 commit e779ec0
Show file tree
Hide file tree
Showing 7 changed files with 73 additions and 8 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,6 @@ jobs:
run: composer install --prefer-dist --no-progress --no-interaction

- name: Run PHPUnit tests
run: vendor/bin/phpunit
run: vendor/bin/phpunit
- name: Run PhpStan Analyse Code
run: vendor/bin/phpstan analyse --level=2 src tests
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"php": ">=8.0"
},
"require-dev": {
"phpunit/phpunit": "9.6.*"
"phpunit/phpunit": "9.6.*",
"phpstan/phpstan": "^1.10"
},
"autoload": {
"psr-4": {
Expand Down
64 changes: 63 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/Entities/BaseEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
abstract class BaseEntity
{
/**
* @var
* @var array<object>
*/
protected $items;

/**
* @var
* @var array<string>
*/
protected $keys;

Expand Down
2 changes: 1 addition & 1 deletion src/Entities/Category.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function find($id)
* Find category by short code
*
* @param $short_code
* @return |null
* @return string|null
*/
public function findByShortCode($short_code)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Entities/District.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function getDistrictsByProvince($provinceId)
* Find district by id
*
* @param $id
* @return false|int|string
* @return object|null
*/
public function find($id)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Entities/Municipality.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public function getMunicipalityByProvince($provinceId)
* Find municipality by id
*
* @param $id
* @return false|int|string
* @return object|null
*/
public function find($id)
{
Expand Down

0 comments on commit e779ec0

Please sign in to comment.