Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 6 additions & 56 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,56 +15,6 @@ orbs:

executors:
php_min:
resource_class: 'small'
environment:
<<: *env_app
<<: *env_composer
docker:
-
name: 'main'
image: 'cimg/php:7.2'

php_plus1:
resource_class: 'small'
environment:
<<: *env_app
<<: *env_composer
docker:
-
name: 'main'
image: 'cimg/php:7.3'

php_plus2:
resource_class: 'small'
environment:
<<: *env_app
<<: *env_composer
docker:
-
name: 'main'
image: 'cimg/php:7.4'

php_plus3:
resource_class: 'small'
environment:
<<: *env_app
<<: *env_composer
docker:
-
name: 'main'
image: 'cimg/php:8.0'

php_plus4:
resource_class: 'small'
environment:
<<: *env_app
<<: *env_composer
docker:
-
name: 'main'
image: 'cimg/php:8.1'

php_plus5:
resource_class: 'small'
environment:
<<: *env_app
Expand All @@ -74,7 +24,7 @@ executors:
name: 'main'
image: 'cimg/php:8.2'

php_plus6:
php_plus1:
resource_class: 'small'
environment:
<<: *env_app
Expand Down Expand Up @@ -140,6 +90,11 @@ commands:
name: 'Run PHPCS'
command: |-
"$(composer config 'bin-dir')/phpcs"
-
run:
name: 'Run PHPStan'
command: |-
"$(composer config 'bin-dir')/phpstan" analyze

test:
description: 'Run tests'
Expand Down Expand Up @@ -211,8 +166,3 @@ workflows:
executor:
- 'php_min'
- 'php_plus1'
- 'php_plus2'
- 'php_plus3'
- 'php_plus4'
- 'php_plus5'
- 'php_plus6'
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[{.phpstan/,phpstan}*.neon]
indent_style = tab

[tests/fixtures/**]
indent_style = unset
indent_size = unset
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,9 @@
/phpcs.xml


### PHPStan.
/phpstan.neon


### PHPUnit.
/phpunit.xml
2 changes: 2 additions & 0 deletions .phpstan/parameters.general.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
parameters:
level: 7
2 changes: 2 additions & 0 deletions .phpstan/parameters.ignoreErrors.baseline.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
parameters:
ignoreErrors: []
2 changes: 2 additions & 0 deletions .phpstan/parameters.ignoreErrors.custom.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
parameters:
ignoreErrors: []
4 changes: 4 additions & 0 deletions .phpstan/parameters.paths.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
parameters:
paths:
- ../src/
- ../tests/src/
2 changes: 2 additions & 0 deletions .phpstan/parameters.typeAliases.dev.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
parameters:
typeAliases: {}
2 changes: 2 additions & 0 deletions .phpstan/parameters.typeAliases.prod.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
parameters:
typeAliases: {}
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
# Mindscreen\YarnLock

[![CircleCI](https://circleci.com/gh/mindscreen/yarnlock/tree/master.svg?style=svg)](https://circleci.com/gh/mindscreen/yarnlock/?branch=master)
[![codecov](https://codecov.io/gh/mindscreen/yarnlock/branch/master/graph/badge.svg?token=HSF16OGPyr)](https://app.codecov.io/gh/mindscreen/yarnlock/branch/master)
[![CircleCI](https://circleci.com/gh/sweetchuck/mindscreen-yarnlock/tree/2.x.svg?style=svg)](https://circleci.com/gh/sweetchuck/mindscreen-yarnlock/?branch=2.x)
[![codecov](https://codecov.io/gh/sweetchuck/mindscreen-yarnlock/branch/2.x/graph/badge.svg?token=HSF16OGPyr)](https://app.codecov.io/gh/sweetchuck/mindscreen-yarnlock/branch/2.x)
Comment on lines +3 to +4
Copy link
Member

Choose a reason for hiding this comment

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

reminder to change this back in the end



A php-package for parsing and evaluating the [yarn.lock](https://yarnpkg.com/lang/en/docs/yarn-lock/) format.


## Basic Usage

```php
<?php
use Mindscreen\YarnLock;
Expand All @@ -19,8 +21,12 @@ $babelCorePackages = $yarnLock->getPackagesByName('babel-core');
$babelCoreDependencies = $babelCorePackages[0]->getDependencies();
```


## Package Depth
If you maybe don't just want all packages but only the direct dependencies plus one level of indirection, you have to go a little extra mile:

If you maybe don't just want all packages but only the direct dependencies plus
one level of indirection, you have to go a little extra mile:

```php
<?php
use Mindscreen\YarnLock;
Expand Down
16 changes: 9 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@
}
],
"config": {
"platform": {
"php": "7.2"
},
"optimize-autoloader": true,
"sort-packages": true
},
"require": {
"php": ">=7.2",
"php": ">=8.2",
"ext-ctype": "*"
},
"require-dev": {
"phpunit/phpunit": "^8.5",
"squizlabs/php_codesniffer": "^3.9"
"jetbrains/phpstorm-attributes": "^1.0",
Copy link
Member

Choose a reason for hiding this comment

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

Might need specific testing, but I had issues with reflection in the past, when a library did not provide the attributes they were using.

"phpstan/phpstan": "^1.10",
"phpunit/phpunit": "^11.0",
"squizlabs/php_codesniffer": "^3.9",
"symfony/filesystem": "^7.0"
},
"autoload": {
"psr-4": {
Expand All @@ -37,10 +37,12 @@
"scripts": {
"lint": [
"@lint:composer-validate",
"@lint:phpcs"
"@lint:phpcs",
"@lint:phpstan"
],
"lint:composer-validate": "\"${COMPOSER_BINARY}\" validate",
"lint:phpcs": "phpcs",
"lint:phpstan": "phpstan analyze",
"test": [
"mkdir -p '.cache' 'reports/human' 'reports/machine'",
"@test:phpunit"
Expand Down
Loading