Skip to content

Commit 8ad2656

Browse files
authored
Merge pull request #1 from Riimu/next
Implement next version changes
2 parents 5145afa + d04e2b9 commit 8ad2656

File tree

14 files changed

+215
-98
lines changed

14 files changed

+215
-98
lines changed

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ tests export-ignore
77
.gitignore export-ignore
88
.php_cs export-ignore
99
.travis.yml export-ignore
10-
apigen.neon export-ignore
1110
phpunit.xml export-ignore
11+
sami_config.php export-ignore

.gitignore

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
.idea
2-
api
3-
coverage
4-
vendor
1+
build/
2+
vendor/
3+
composer.lock

.php_cs

Lines changed: 94 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,101 @@
11
<?php
22

3-
$finder = Symfony\CS\Finder\DefaultFinder::create()
3+
$finder = \PhpCsFixer\Finder::create()
44
->in(__DIR__ . '/src')
55
->in(__DIR__ . '/tests');
66

7-
return Symfony\CS\Config\Config::create()
8-
->fixers([
9-
'align_double_arrow',
10-
'concat_with_spaces',
11-
'ereg_to_preg',
12-
'multiline_spaces_before_semicolon',
13-
'newline_after_open_tag',
14-
'ordered_use',
15-
'php4_constructor',
16-
'php_unit_construct',
17-
'php_unit_strict',
18-
'short_array_syntax',
19-
'strict',
20-
'strict_param',
7+
return \PhpCsFixer\Config::create()
8+
->setRules([
9+
'@PSR2' => true,
2110

22-
'-concat_without_spaces',
23-
'-linefeed',
24-
'-phpdoc_no_empty_return',
25-
'-phpdoc_params',
26-
'-phpdoc_separation',
27-
'-pre_increment',
28-
'-unalign_double_arrow',
29-
'-unary_operators_spaces',
11+
'array_syntax' => [
12+
'syntax' => 'short'
13+
],
14+
'binary_operator_spaces' => [
15+
'align_double_arrow' => null,
16+
'align_equals' => false,
17+
],
18+
'blank_line_after_opening_tag' => true,
19+
'cast_spaces' => true,
20+
'combine_consecutive_unsets' => true,
21+
'concat_space' => [
22+
'spacing' => 'one'
23+
],
24+
'declare_equal_normalize' => true,
25+
'dir_constant' => true,
26+
'ereg_to_preg' => true,
27+
'function_to_constant' => true,
28+
'function_typehint_space' => true,
29+
'hash_to_slash_comment' => true,
30+
'heredoc_to_nowdoc' => true,
31+
'include' => true,
32+
'is_null' => true,
33+
'lowercase_cast' => true,
34+
'magic_constant_casing' => true,
35+
'method_separation' => true,
36+
'modernize_types_casting' => true,
37+
'native_function_casing' => true,
38+
'new_with_braces' => true,
39+
'no_alias_functions' => true,
40+
'no_blank_lines_after_class_opening' => true,
41+
'no_blank_lines_after_phpdoc' => true,
42+
'no_empty_comment' => true,
43+
'no_empty_phpdoc' => true,
44+
'no_empty_statement' => true,
45+
'no_extra_consecutive_blank_lines' => true,
46+
'no_leading_import_slash' => true,
47+
'no_leading_namespace_whitespace' => true,
48+
'no_mixed_echo_print' => true,
49+
'no_multiline_whitespace_around_double_arrow' => true,
50+
'no_multiline_whitespace_before_semicolons' => true,
51+
'no_php4_constructor' => true,
52+
'no_short_bool_cast' => true,
53+
'no_singleline_whitespace_before_semicolons' => true,
54+
'no_spaces_around_offset' => true,
55+
'no_trailing_comma_in_list_call' => true,
56+
'no_trailing_comma_in_singleline_array' => true,
57+
'no_unneeded_control_parentheses' => true,
58+
'no_unused_imports' => true,
59+
'no_useless_return' => true,
60+
'no_whitespace_before_comma_in_array' => true,
61+
'no_whitespace_in_blank_line' => true,
62+
'non_printable_character' => true,
63+
'normalize_index_brace' => true,
64+
'object_operator_without_whitespace' => true,
65+
'ordered_class_elements' => [
66+
'order' => ['use_trait', 'constant', 'property', 'construct', 'method'],
67+
],
68+
'ordered_imports' => true,
69+
'php_unit_construct' => true,
70+
'php_unit_dedicate_assert' => true,
71+
'php_unit_strict' => true,
72+
'phpdoc_add_missing_param_annotation' => true,
73+
'phpdoc_annotation_without_dot' => true,
74+
'phpdoc_indent' => true,
75+
'phpdoc_inline_tag' => true,
76+
'phpdoc_no_access' => true,
77+
'phpdoc_no_alias_tag' => true,
78+
'phpdoc_no_package' => true,
79+
'phpdoc_scalar' => true,
80+
'phpdoc_single_line_var_spacing' => true,
81+
'phpdoc_summary' => true,
82+
'phpdoc_trim' => true,
83+
'phpdoc_types' => true,
84+
'phpdoc_var_without_name' => true,
85+
'pow_to_exponentiation' => true,
86+
'psr4' => true,
87+
'return_type_declaration' => true,
88+
'self_accessor' => true,
89+
'short_scalar_cast' => true,
90+
'single_blank_line_before_namespace' => true,
91+
'single_quote' => true,
92+
'space_after_semicolon' => true,
93+
'standardize_not_equals' => true,
94+
'strict_comparison' => true,
95+
'strict_param' => true,
96+
'ternary_operator_spaces' => true,
97+
'trailing_comma_in_multiline_array' => true,
98+
'trim_array_spaces' => true,
99+
'whitespace_after_comma_in_array' => true,
30100
])
31-
->finder($finder);
101+
->setFinder($finder);

.travis.yml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,31 @@
11
language: php
22
sudo: false
3+
dist: trusty
34

45
php:
56
- 5.6
6-
- 5.5
7-
- 5.4
7+
- 7.0
8+
- 7.1
9+
- hhvm
810

911
cache:
1012
directories:
11-
- vendor
13+
- vendor
1214

1315
before_install:
14-
- composer self-update
16+
- export XDEBUG="/home/travis/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini"
17+
- is_hhvm () { [[ $TRAVIS_PHP_VERSION =~ ^hhvm ]]; }
18+
- is_hhvm || mv -v "$XDEBUG" "$XDEBUG.disabled"
1519

1620
install:
17-
- composer require --no-update --no-interaction "phpunit/phpunit:4.*" "squizlabs/php_codesniffer:2.*" "fabpot/php-cs-fixer:1.*"
18-
- travis_retry composer install --no-interaction
21+
- travis_retry composer update -a --no-interaction
1922
- travis_retry wget https://scrutinizer-ci.com/ocular.phar
2023

2124
script:
22-
- vendor/bin/phpunit --coverage-clover=coverage.clover
2325
- vendor/bin/phpcs --standard=PSR2 src tests
24-
- vendor/bin/php-cs-fixer fix --dry-run --diff
26+
- vendor/bin/php-cs-fixer fix -v --dry-run --allow-risky=yes --using-cache=no
27+
- if is_hhvm; then echo "xdebug.enable = On" >> /etc/hhvm/php.ini; else mv -v "$XDEBUG.disabled" "$XDEBUG"; fi
28+
- vendor/bin/phpunit --coverage-clover=coverage.clover --coverage-text
2529

2630
after_script:
27-
- php ocular.phar code-coverage:upload --format=php-clover coverage.clover
31+
- is_hhvm || php ocular.phar code-coverage:upload --format=php-clover coverage.clover

CHANGES.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog #
22

3+
## v1.2.0 (2017-07-09) ##
4+
5+
* Minor changes to path joining logic
6+
* Increased minimum required PHP version to 5.6
7+
* Updated tests to work with PHPUnit 6
8+
* Updated travis build
9+
* Slightly improved the bundled autoloader
10+
311
## v1.1.2 (2015-08-22) ##
412

513
* Slightly reworked how the paths are built

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2014 - 2015 Riikka Kalliomäki
1+
Copyright (c) 2014-2017 Riikka Kalliomäki
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy of
44
this software and associated documentation files (the "Software"), to deal in

README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,18 @@ case since it works by using the file system. This library simply combines and
1515
normalizes the paths using string handling. There is no requirement for the
1616
files or directories to be readable or even exist.
1717

18-
The API documentation, which can be generated using Apigen, can be read online
19-
at: http://kit.riimu.net/api/pathjoin/
18+
The API documentation is available at: http://kit.riimu.net/api/pathjoin/
2019

21-
[![Build Status](https://img.shields.io/travis/Riimu/Kit-PathJoin.svg?style=flat)](https://travis-ci.org/Riimu/Kit-PathJoin)
22-
[![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/Riimu/Kit-PathJoin.svg?style=flat)](https://scrutinizer-ci.com/g/Riimu/Kit-PathJoin/)
23-
[![Scrutinizer Code Quality](https://img.shields.io/scrutinizer/g/Riimu/Kit-PathJoin.svg?style=flat)](https://scrutinizer-ci.com/g/Riimu/Kit-PathJoin/)
20+
[![Travis](https://img.shields.io/travis/Riimu/Kit-PathJoin.svg?style=flat-square)](https://travis-ci.org/Riimu/Kit-PathJoin)
21+
[![Scrutinizer](https://img.shields.io/scrutinizer/g/Riimu/Kit-PathJoin.svg?style=flat-square)](https://scrutinizer-ci.com/g/Riimu/Kit-PathJoin/)
22+
[![Scrutinizer Coverage](https://img.shields.io/scrutinizer/coverage/g/Riimu/Kit-PathJoin.svg?style=flat-square)](https://scrutinizer-ci.com/g/Riimu/Kit-PathJoin/)
23+
[![Packagist](https://img.shields.io/packagist/v/riimu/kit-pathjoin.svg?style=flat-square)](https://packagist.org/packages/riimu/kit-pathjoin)
2424

2525
## Requirements ##
2626

2727
In order to use this library, the following requirements must be met:
2828

29-
* PHP version 5.4
29+
* PHP version 5.6
3030

3131
## Installation ##
3232

@@ -131,6 +131,6 @@ echo Path::normalize('/foo/bar', false) . PHP_EOL; // outputs '\foo\Bar'
131131

132132
## Credits ##
133133

134-
This library is copyright 2014 - 2015 to Riikka Kalliomäki.
134+
This library is Copyright (c) 2014-2017 Riikka Kalliomäki.
135135

136136
See LICENSE for license and copying information.

apigen.neon

Lines changed: 0 additions & 12 deletions
This file was deleted.

composer.json

Lines changed: 36 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,39 @@
11
{
2-
"name": "riimu/kit-pathjoin",
3-
"type": "library",
4-
"description": "Cross-platform library for normalizing and joining file system paths",
5-
"homepage": "http://kit.riimu.net",
6-
"keywords": ["normalize", "join", "file", "system", "path"],
7-
"license": "MIT",
8-
"authors": [
9-
{
10-
"name": "Riikka Kalliomäki",
11-
"email": "[email protected]",
12-
"homepage": "http://riimu.net"
13-
}
14-
],
15-
"require": {
16-
"php": ">=5.4.0"
17-
},
18-
"autoload": {
19-
"psr-4": {
20-
"Riimu\\Kit\\PathJoin\\": "src/"
21-
}
2+
"name": "riimu/kit-pathjoin",
3+
"type": "library",
4+
"description": "Cross-platform library for normalizing and joining file system paths",
5+
"homepage": "http://kit.riimu.net",
6+
"keywords": [
7+
"normalize",
8+
"join",
9+
"file",
10+
"system",
11+
"path"
12+
],
13+
"license": "MIT",
14+
"authors": [
15+
{
16+
"name": "Riikka Kalliomäki",
17+
"email": "[email protected]",
18+
"homepage": "http://riimu.net"
2219
}
20+
],
21+
"require": {
22+
"php": ">=5.4.0"
23+
},
24+
"require-dev": {
25+
"phpunit/phpunit": "^5.7 || ^6.2",
26+
"squizlabs/php_codesniffer": "^3.0",
27+
"friendsofphp/php-cs-fixer": "^2.3"
28+
},
29+
"autoload": {
30+
"psr-4": {
31+
"Riimu\\Kit\\PathJoin\\": "src/"
32+
}
33+
},
34+
"autoload-dev": {
35+
"psr-4": {
36+
"Riimu\\Kit\\PathJoin\\": "tests/tests/"
37+
}
38+
}
2339
}

sami_config.php

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?php
2+
3+
use Sami\RemoteRepository\GitHubRemoteRepository;
4+
use Sami\Sami;
5+
use Symfony\Component\Finder\Finder;
6+
7+
$iterator = Finder::create()
8+
->files()
9+
->name('*.php')
10+
->in(__DIR__ . '/src');
11+
12+
$theme = getenv('SAMI_THEME');
13+
$settings = [];
14+
15+
if ($theme) {
16+
$settings['theme'] = basename($theme);
17+
$settings['template_dirs'] = [dirname($theme)];
18+
}
19+
20+
return new Sami($iterator, $settings + [
21+
'title' => 'Kit PathJoin API',
22+
'build_dir' => __DIR__ . '/build/doc',
23+
'cache_dir' => __DIR__ . '/build/cache',
24+
'remote_repository' => new GitHubRemoteRepository('Riimu/Kit-PathJoin', __DIR__),
25+
'default_opened_level' => 3,
26+
]);

0 commit comments

Comments
 (0)