Skip to content

Commit

Permalink
Merge pull request #7 from MontealegreLuis/variadic-params-visibility…
Browse files Browse the repository at this point in the history
…-constants

Variadic & By Reference parameters
  • Loading branch information
MontealegreLuis authored Jun 27, 2021
2 parents 0701c60 + ca0a668 commit 1a35833
Show file tree
Hide file tree
Showing 237 changed files with 2,025 additions and 1,744 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: "Install PHP with extensions"
uses: "shivammathur/setup-php@v2"
with:
php-version: "7.1"
php-version: "7.2"
extensions: imagick
ini-values: memory_limit=-1
coverage: xdebug
Expand Down
41 changes: 41 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Publish

on:
push:
tags:
- '*'

jobs:
build:
name: Publish PHAR file
runs-on: ubuntu-latest

steps:
- name: "Checkout project"
uses: actions/checkout@v1

- name: "Install PHP with extensions"
uses: "shivammathur/setup-php@v2"
with:
php-version: "7.2"
extensions: imagick
ini-values: memory_limit=-1, phar.readonly=Off
tools: composer:v1

- name: "Install dependencies with composer"
run: |
sudo apt-get install graphviz
composer install --optimize-autoloader --prefer-dist --no-interaction --no-progress --no-suggest --no-dev
- name: "Build PHAR file"
run: |
wget https://github.com/box-project/box/releases/download/3.13.0/box.phar
./box.phar compile -vv
gpg -u [email protected] --detach-sign --output phuml.phar.asc phuml.phar
- name: "Upload binaries to distribute phUML via PHIVE"
uses: "svenstaro/upload-release-action@v2"
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: phuml.phar*
tag: ${{ github.ref }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
vendor
composer.lock
composer.*
build
coverage.clover
.php-cs-fixer.cache
.phpunit.result.cache
.couscous
box.phar
phuml.phar
phuml.phar.pubkey
phuml.phar.version
23 changes: 20 additions & 3 deletions .php-cs-fixer-tests.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
<?php declare(strict_types=1);
/**
* PHP version 7.1
* PHP version 7.2
*
* This source file is subject to the license that is bundled with this package in the file LICENSE.
*/
Expand All @@ -12,7 +12,7 @@
$config = new PhpCsFixer\Config();

return $config->setRules([
'@PSR2' => true,
'@PSR12' => true,
'visibility_required' => false,
'no_unused_imports' => true,
'array_syntax' => ['syntax' => 'short'],
Expand All @@ -29,5 +29,22 @@
'combine_consecutive_unsets' => true,
'no_whitespace_in_blank_line' => true,
'class_attributes_separation' => ['elements' => ['const' => 'one', 'method' => 'one', 'property' => 'one']],
'cast_spaces' => ['space' => 'single'],
'single_blank_line_at_eof' => true,
'not_operator_with_successor_space' => true,
'yoda_style' => ['equal' => false, 'identical' => false, 'less_and_greater' => false],
'return_type_declaration' => ['space_before' => 'none'],
'modernize_types_casting' => true,
'blank_line_after_opening_tag' => false,
'declare_strict_types' => true,
'header_comment' => [
'header' => 'PHP version 7.2
This source file is subject to the license that is bundled with this package in the file LICENSE.',
'comment_type' => 'PHPDoc',
'location' => 'after_declare_strict',
'separate' => 'bottom'
],
])
->setRiskyAllowed(true)
->setFinder($finder);
23 changes: 20 additions & 3 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
<?php declare(strict_types=1);
/**
* PHP version 7.1
* PHP version 7.2
*
* This source file is subject to the license that is bundled with this package in the file LICENSE.
*/
Expand All @@ -11,7 +11,7 @@
$config = new PhpCsFixer\Config();

return $config->setRules([
'@PSR2' => true,
'@PSR12' => true,
'no_unused_imports' => true,
'array_syntax' => ['syntax' => 'short'],
'single_blank_line_before_namespace' => true,
Expand All @@ -27,5 +27,22 @@
'combine_consecutive_unsets' => true,
'no_whitespace_in_blank_line' => true,
'class_attributes_separation' => ['elements' => ['const' => 'one', 'method' => 'one', 'property' => 'one']],
'cast_spaces' => ['space' => 'single'],
'single_blank_line_at_eof' => true,
'not_operator_with_successor_space' => true,
'yoda_style' => ['equal' => false, 'identical' => false, 'less_and_greater' => false],
'return_type_declaration' => ['space_before' => 'none'],
'modernize_types_casting' => true,
'blank_line_after_opening_tag' => false,
'declare_strict_types' => true,
'header_comment' => [
'header' => 'PHP version 7.2
This source file is subject to the license that is bundled with this package in the file LICENSE.',
'comment_type' => 'PHPDoc',
'location' => 'after_declare_strict',
'separate' => 'bottom'
],
])
->setRiskyAllowed(true)
->setFinder($finder);
3 changes: 0 additions & 3 deletions .travis/.gitignore

This file was deleted.

Binary file removed .travis/secrets.tar.enc
Binary file not shown.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ADD src/ src
RUN composer global require hirak/prestissimo --no-plugins --no-scripts
RUN composer install --optimize-autoloader --prefer-dist --no-progress --no-interaction --ignore-platform-reqs

FROM php:7.1.30-cli-alpine AS phuml
FROM php:7.2.34-cli-alpine3.12 AS phuml
MAINTAINER Luis Montealegre <[email protected]>

RUN apk add --update --no-cache autoconf g++ pkgconfig imagemagick imagemagick-dev make ttf-freefont graphviz \
Expand Down
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@ stats:
@docker-compose run --rm tests php bin/phuml phuml:statistics $(ARGS)

format:
@vendor/bin/rector process
@vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.php -v --using-cache no
@vendor/bin/php-cs-fixer fix --config=.php-cs-fixer-tests.php -v --using-cache no

check:
@vendor/bin/grumphp run
@vendor/bin/composer-require-checker check
@docker-compose run --rm tests vendor/bin/phpunit --testsuite 'Integration tests'
@vendor/bin/php-cs-fixer fix --config=.php-cs-fixer-tests.php -v --dry-run --using-cache no
@vendor/bin/php-cs-fixer fix --config=.php-cs-fixer-tests.php -v --dry-run --using-cache=no
@vendor/bin/rector process --dry-run
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
# phUML

![CI workflow](https://github.com/montealegreluis/phuml/actions/workflows/ci.yml/badge.svg)
[![CI workflow](https://github.com/montealegreluis/phuml/actions/workflows/ci.yml/badge.svg)](https://github.com/montealegreluis/phuml/actions/workflows/ci.yml)
[![Scrutinizer Code Quality][scrutinizer-badge]][scrutinizer]
[![Code Coverage][coverage-badge]][coverage]
[![Latest Stable Version][stable-badge]][packagist]
[![Packagist Pre Release][unstable-badge]][packagist]
[![Minimum PHP Version][php-version-badge]][php]

phUML is a fully automatic [UML][uml] class diagram generator written in [PHP][php].
It creates a class diagram from an OO codebase based on the UML specification.
It creates a class diagram from an Object-Oriented codebase based on the UML specification.

## Installation

Expand All @@ -20,14 +19,16 @@ The official phUML Docker image can be found on [Docker Hub](https://hub.docker.
docker pull montealegreluis/phuml:2.0.0
```

You can replace `2.0.0` with any of th available [tags](https://hub.docker.com/r/montealegreluis/phuml/tags?page=1&ordering=last_updated)
You can replace `2.0.0` with any of the available [tags](https://hub.docker.com/r/montealegreluis/phuml/tags?page=1&ordering=last_updated)

### Composer

Alternatively, you may use [Composer][composer] to download and install phUML as well as its dependencies.

```
$ composer require phuml/phuml
composer require phuml/phuml
# or globally
composer global require phuml/phuml
```

## How does it look like?
Expand Down Expand Up @@ -69,7 +70,6 @@ Special thanks to all of these [awesome contributors][contributors].
[packagist]: https://packagist.org/packages/phuml/phuml
[php-version-badge]: https://img.shields.io/badge/php-%3E%3D%207.1-8892BF.svg?style=flat-square
[php]: https://php.net/
[unstable-badge]: https://img.shields.io/packagist/vpre/phuml/phuml.svg
[luis]: https://github.com/MontealegreLuis
[jakob]: https://github.com/jakobwesthoff
[contributors]: https://github.com/MontealegreLuis/phuml/contributors
Expand Down
7 changes: 0 additions & 7 deletions bin/phuml
Original file line number Diff line number Diff line change
Expand Up @@ -24,18 +24,11 @@ if (!$installed) {
die(1);
}

use Humbug\SelfUpdate\Updater;
use PhUml\Console\Commands\SelfUpdateCommand;
use PhUml\Console\PhUmlApplication;
use PhUml\Console\ProgressDisplay;
use PhUml\Console\UpdaterDisplay;
use Symfony\Component\Console\Input\ArgvInput;
use Symfony\Component\Console\Output\ConsoleOutput;

$output = new ConsoleOutput();
$application = new PhUmlApplication(new ProgressDisplay($output));
if (0 === strpos(__FILE__, 'phar:')) {
$application->add(new SelfUpdateCommand(new Updater(), new UpdaterDisplay($output)));
}

$application->run(new ArgvInput(), $output);
7 changes: 1 addition & 6 deletions box.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
{
"algorithm": "OPENSSL",
"chmod": "0755",
"compression": "GZ",
"directories": [
"src"
Expand All @@ -21,8 +19,5 @@
],
"git-version": "package_version",
"intercept": true,
"key": ".travis/phar-private.pem",
"main": "bin/phuml",
"output": "phuml.phar",
"stub": true
"output": "phuml.phar"
}
29 changes: 15 additions & 14 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,39 +15,40 @@
}
],
"require": {
"php": "^7.1",
"php": "^7.2",
"ext-tokenizer": "*",
"nikic/php-parser": "^4.10.5",
"padraic/phar-updater": "^1.0.6",
"symfony/console": "^4.4.24",
"symfony/filesystem": "^4.4.22",
"symfony/finder": "^4.4.24",
"symfony/process": "^4.4.22",
"twig/twig": "^2.13.1",
"webmozart/assert": "^1.9.1"
"symfony/console": "^5.3.0",
"symfony/filesystem": "^5.3.0",
"symfony/finder": "^5.3.0",
"symfony/process": "^5.3.0",
"twig/twig": "^3.3.2",
"webmozart/assert": "^1.10.0"
},
"require-dev": {
"ext-imagick": "*",
"ergebnis/composer-normalize": "^2.8.0",
"ergebnis/composer-normalize": "^2.14.0",
"friendsofphp/php-cs-fixer": "^3.0.0",
"lupka/phpunit-compare-images": "^1.0.0",
"maglnet/composer-require-checker": "^2.0.0",
"phpro/grumphp": "^0.16.2",
"maglnet/composer-require-checker": "^2.1.0",
"phpro/grumphp": "^0.19.1",
"phpstan/extension-installer": "^1.1.0",
"phpstan/phpstan": "^0.12.88",
"phpstan/phpstan-strict-rules": "^0.12.9",
"phpunit/phpunit": "^7.5.20"
"phpunit/phpunit": "^8.5.15",
"pyrech/composer-changelogs": "^1.7.1",
"rector/rector": "^0.11.8"
},
"config": {
"optimize-autoloader": true,
"platform": {
"php": "7.1.30"
"php": "7.2.34"
},
"sort-packages": true
},
"extra": {
"branch-alias": {
"dev-master": "2.0-dev"
"dev-master": "4.0-dev"
}
},
"autoload": {
Expand Down
9 changes: 5 additions & 4 deletions containers/tests/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
FROM ubuntu:xenial
FROM php:7.2.34-cli-alpine3.12

RUN apk add --update --no-cache autoconf g++ pkgconfig imagemagick imagemagick-dev make ttf-freefont graphviz \
&& printf "\n" | pecl install imagick \
&& echo "extension=imagick.so" >> /usr/local/etc/php/php.ini

RUN apt-get update -y && apt-get install -y software-properties-common python-software-properties
RUN LC_ALL=C.UTF-8 add-apt-repository ppa:ondrej/php
RUN apt-get update -y && apt-get install -y git graphviz pkg-config libmagickwand-dev imagemagick php7.1 php7.1-cli php7.1-common php7.1-dev php7.1-xml php7.1-xdebug php7.1-imagick
RUN mkdir -p /usr/src/phuml

WORKDIR /usr/src/phuml
Loading

0 comments on commit 1a35833

Please sign in to comment.