Skip to content

Commit

Permalink
Literal octal notation
Browse files Browse the repository at this point in the history
  • Loading branch information
MathiasReker committed Sep 3, 2022
1 parent 767404b commit b538306
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 17 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,10 @@ jobs:
run: composer run-script test

- name: Run PHP CS fixer
run: composer run-script php-cs-fixer
run: composer run-script cs-check

- name: Run phpstan
run: composer run-script phpstan

- name: Run ergebnis/composer-normalize
run: composer normalize --dry-run --no-check-lock

29 changes: 26 additions & 3 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,41 @@
$config
->setRiskyAllowed(true)
->setRules([
'header_comment' => [
'header' => $header,
'comment_type' => 'PHPDoc',
'location' => 'after_open',
'separate' => 'bottom'
],
'@PHP74Migration' => true,
'@PHP74Migration:risky' => true,
'@PHPUnit75Migration:risky' => true,
'@Symfony' => true,
'@Symfony:risky' => true,
'concat_space' => [
'spacing' => 'one',
],
'array_indentation' => true,
'general_phpdoc_annotation_remove' => ['annotations' => ['expectedDeprecation']],
'header_comment' => ['header' => $header, 'comment_type' => 'PHPDoc', 'location' => 'after_open', 'separate' => 'bottom'],
'general_phpdoc_annotation_remove' => [
'annotations' => [
'expectedDeprecation'
]
],
'use_arrow_functions' => true,
'control_structure_braces' => true,
'control_structure_continuation_position' => true,
'self_static_accessor' => true,
'ordered_interfaces' => true,
'phpdoc_var_annotation_correct_order' => true,
'return_assignment' => true,
'no_useless_else' => true,
'no_superfluous_elseif' => true,
'no_useless_return' => true,
'multiline_comment_opening_closing' => true,
'no_null_property_initialization' => true,
'operator_linebreak' => true,
'method_chaining_indentation' => true,
'strict_param' => true,
'strict_comparison' => true,
])
->setFinder($finder)
->setLineEnding(PHP_EOL);
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM composer:latest AS composer
FROM php:8.1-fpm
COPY --from=composer /usr/bin/composer /usr/bin/composer
LABEL org.opencontainers.image.description="php-chmod is a PHP library for easily changing permissions recursively."
LABEL org.opencontainers.image.description="php-chmod is a PHP library for easily changing file/directory permissions recursively."
WORKDIR /app
COPY . .
RUN apt-get update && apt-get -y upgrade && apt-get -y install zip
Expand Down
18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@
[![Issues](https://img.shields.io/github/issues/MathiasReker/php-chmod.svg)](https://github.com/MathiasReker/php-chmod/issues)
[![MIT License](https://img.shields.io/github/license/MathiasReker/php-chmod.svg)](https://github.com/MathiasReker/php-chmod/blob/develop/LICENSE.txt)

`php-chmod` is a PHP library for easily changing the permissions recursively.
`php-chmod` is a PHP library for easily changing file/directory permissions recursively.

✅ Literal octal notation (0o) is supported

### Versions & Dependencies

| Version | PHP | Documentation |
|---------|------|---------------|
| ^2.0 | ^7.4 | current |
| ^2.1 | ^7.4 | current |

### Requirements

Expand Down Expand Up @@ -168,7 +170,7 @@ with the tag "enhancement". Finally, don't forget to give the project a star! Th
If you are using docker, you can use the following command to get started:

```bash
docker-compose up --build -d
docker-compose up -d
```

Next, access the container:
Expand All @@ -182,12 +184,18 @@ docker exec -it php-chmod bash
PHP Coding Standards Fixer:

```bash
composer run-script php-cs-fixer
composer run-script cs-fix
```

PHP Stan:
PHP Coding Standards Checker:

```bash
composer run-script cs-check
```

PHP Stan:

```bash
composer run-script phpstan
```

Expand Down
7 changes: 4 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mathiasreker/php-chmod",
"description": "php-chmod is a PHP library for easily changing permissions recursively.",
"description": "php-chmod is a PHP library for easily changing file/directory permissions recursively.",
"license": "MIT",
"type": "library",
"keywords": [
Expand Down Expand Up @@ -45,8 +45,9 @@
"sort-packages": true
},
"scripts": {
"php-cs-fixer": "./vendor/bin/php-cs-fixer fix .",
"phpstan": "./vendor/bin/phpstan analyse src --level=9",
"cs-check": "./vendor/bin/php-cs-fixer fix . --dry-run --diff",
"cs-fix": "./vendor/bin/php-cs-fixer fix .",
"phpstan": "./vendor/bin/phpstan analyse src/ --level=9",
"test": "./vendor/bin/phpunit --bootstrap vendor/autoload.php --colors=always tests/"
}
}
4 changes: 1 addition & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ version: "3"
services:
app:
build: .
image: php-chmod:2.0
image: php-chmod:2.1
container_name: "php-chmod"
ports:
- "8080:80"
volumes:
- ./:/app

0 comments on commit b538306

Please sign in to comment.