Skip to content
This repository has been archived by the owner on Sep 16, 2021. It is now read-only.

Commit

Permalink
DevKit updates (#46)
Browse files Browse the repository at this point in the history
* DevKit updates

* DevKit updates

* Apply fixes from StyleCI (#47)

[ci skip] [skip ci]
  • Loading branch information
ElectricMaxxx authored Oct 27, 2017
1 parent 2ba34f4 commit edbe0c7
Show file tree
Hide file tree
Showing 21 changed files with 341 additions and 85 deletions.
23 changes: 23 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
root = true

[*]
end_of_line = lf
indent_style = space
charset = utf-8
insert_final_newline = true
trim_trailing_whitespace = true

[*.{yml,twig,php}]
indent_size = 4

[*.{js,json,scss,css}]
indent_size = 2

[.travis.yml]
indent_size = 2

[composer.json]
indent_size = 4

[Makefile]
indent_style = tab
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.* export-ignore
*.md export-ignore
Tests/* export-ignore
43 changes: 43 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<!--
Before you open an issue, make sure this one does not already exist.
Please also read the "guidelines for contributing" link above before posting.
-->

<!--
If you are reporting a bug, please try to fill in the following.
Otherwise remove it.
-->

### Environment

#### Symfony packages

```
$ composer show --latest 'symfony/*'
```

#### Symfony CMF packages

```
$ composer show --latest 'symfony-cmf/*'
```

## Subject

<!--
Give here as many details as possible.
Next sections are for ERRORS only.
-->

## Steps to reproduce

## Expected results

## Actual results

<!--
If it's an error message or piece of code, use code block tags,
and make sure you provide the whole stack trace(s),
not just the first error message you can see.
More details here: https://github.com/symfony-cmf/resource/blob/master/CONTRIBUTING.md#issues
-->
10 changes: 10 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
| Q | A
| ------------- | ---
| Branch? | "master" for new features / the branch of the current release for fixes
| Bug fix? | yes/no
| New feature? | yes/no
| BC breaks? | yes/no
| Deprecations? | yes/no
| Fixed tickets | comma-separated list of tickets fixed by the PR, if any
| License | MIT
| Doc PR | reference to the documentation PR, if any
29 changes: 24 additions & 5 deletions .styleci.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,29 @@
#######################################################
# DO NOT EDIT THIS FILE! #
# #
# It's auto-generated by symfony-cmf/dev-kit package. #
#######################################################

############################################################################
# This file is part of the Symfony CMF package. #
# #
# (c) 2011-2017 Symfony CMF #
# #
# For the full copyright and license information, please view the LICENSE #
# file that was distributed with this source code. #
############################################################################


preset: symfony

enabled:
- ordered_use
- combine_consecutive_unsets
- short_array_syntax

disabled: [single_line_class_definition]
- newline_after_open_tag
- no_php4_constructor
- no_useless_else
- ordered_use
- strict
- php_unit_construct

finder:
exclude: [puli]
disabled: [single_line_class_definition]
12 changes: 12 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Contributing
------------

Symfony CMF is an open source, community-driven project. We follow the same
guidelines as core Symfony. If you'd like to contribute, please read the
[Contributing Code][1] part of the documentation. If you're submitting a pull
request, please follow the guidelines in the [Submitting a Patch][2] section
and use the [Pull Request Template][3].

[1]: http://symfony.com/doc/current/contributing/code/index.html
[2]: http://symfony.com/doc/current/contributing/code/patches.html#check-list
[3]: http://symfony.com/doc/current/contributing/code/patches.html#make-a-pull-request
33 changes: 33 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#######################################################
# DO NOT EDIT THIS FILE! #
# #
# It's auto-generated by symfony-cmf/dev-kit package. #
#######################################################

############################################################################
# This file is part of the Symfony CMF package. #
# #
# (c) 2011-2017 Symfony CMF #
# #
# For the full copyright and license information, please view the LICENSE #
# file that was distributed with this source code. #
############################################################################

TESTING_SCRIPTS_DIR=vendor/symfony-cmf/testing/bin
CONSOLE=${TESTING_SCRIPTS_DIR}/console
VERSION=dev-master
ifdef BRANCH
VERSION=dev-${BRANCH}
endif
PACKAGE=symfony-cmf/resource

list:
@echo 'test: will run all tests'
@echo 'unit_tests: will run unit tests only'



include ${TESTING_SCRIPTS_DIR}/make/unit_tests.mk

.PHONY: test
test: unit_tests
55 changes: 44 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,75 @@
# Symfony CMF Resource Component
# Symfony CMF Resource

[![Build Status](https://travis-ci.org/symfony-cmf/resource.svg?branch=master)](https://travis-ci.org/symfony-cmf/resource)
[![StyleCI](https://styleci.io/repos/26994566/shield)](https://styleci.io/repos/26994566)
[![Latest Stable Version](https://poser.pugx.org/symfony-cmf/resource/version.png)](https://packagist.org/packages/symfony-cmf/resource)
[![Total Downloads](https://poser.pugx.org/symfony-cmf/resource/d/total.png)](https://packagist.org/packages/symfony-cmf/resource)
[![Latest Stable Version](https://poser.pugx.org/symfony-cmf/resource/v/stable)](https://packagist.org/packages/symfony-cmf/resource)
[![Latest Unstable Version](https://poser.pugx.org/symfony-cmf/resource/v/unstable)](https://packagist.org/packages/symfony-cmf/resource)
[![License](https://poser.pugx.org/symfony-cmf/resource/license)](https://packagist.org/packages/symfony-cmf/resource)

This component is part of the [Symfony Content Management Framework (CMF)](http://cmf.symfony.com/)
and licensed under the [MIT License](LICENSE).
[![Total Downloads](https://poser.pugx.org/symfony-cmf/resource/downloads)](https://packagist.org/packages/symfony-cmf/resource)
[![Monthly Downloads](https://poser.pugx.org/symfony-cmf/resource/d/monthly)](https://packagist.org/packages/symfony-cmf/resource)
[![Daily Downloads](https://poser.pugx.org/symfony-cmf/resource/d/daily)](https://packagist.org/packages/symfony-cmf/resource)

Branch | Travis | Coveralls |
------ | ------ | --------- |
master | [![Build Status][travis_unstable_badge]][travis_unstable_link] | [![Coverage Status][coveralls_unstable_badge]][coveralls_unstable_link] |

This package is part of the [Symfony Content Management Framework (CMF)](http://cmf.symfony.com/) and licensed
under the [MIT License](LICENSE).

The Resource component provides PHPCR/ODM integration with Puli.

> **CAUTION** As Puli is not yet stable, the complete component is marked
> internal. Backwards compatibility of upcoming 1.x versions is not
> guaranteed.
## Requirements

## Requirements

* PHP 5.6 / 7.0 / 7.1
* Symfony
* See also the `require` section of [composer.json](composer.json)

## Documentation

This library is under development and as yet there is no documentation.
For the install guide and reference, see:

* [symfony-cmf/resource Documentation](http://symfony.com/doc/master/cmf/components/resource/index.html)

See also:

* [All Symfony CMF documentation](http://symfony.com/doc/master/cmf/index.html) - complete Symfony CMF reference
* [Symfony CMF Website](http://cmf.symfony.com/) - introduction, live demo, support and community links

## Support

For general support and questions, please use [StackOverflow](http://stackoverflow.com/questions/tagged/symfony-cmf).

## Contributing

Pull requests are welcome. Please see our
[CONTRIBUTING](https://github.com/symfony-cmf/symfony-cmf/blob/master/CONTRIBUTING.md)
guide.

Unit and/or functional tests exist for this component. See the
Unit and/or functional tests exist for this package. See the
[Testing documentation](http://symfony.com/doc/master/cmf/components/testing.html)
for a guide to running the tests.

Thanks to
[everyone who has contributed](https://github.com/symfony-cmf/Resource/contributors) already.
[everyone who has contributed](contributors) already.

## License

This package is available under the [MIT license](src/Resources/meta/LICENSE).

[travis_legacy_badge]: https://travis-ci.org/symfony-cmf/resource.svg?branch=master
[travis_legacy_link]: https://travis-ci.org/symfony-cmf/resource
[travis_stable_badge]: https://travis-ci.org/symfony-cmf/resource.svg?branch=master
[travis_stable_link]: https://travis-ci.org/symfony-cmf/resource
[travis_unstable_badge]: https://travis-ci.org/symfony-cmf/resource.svg?branch=master
[travis_unstable_link]: https://travis-ci.org/symfony-cmf/resource

[coveralls_legacy_badge]: https://coveralls.io/repos/github/symfony-cmf/resource/badge.svg?branch=master
[coveralls_legacy_link]: https://coveralls.io/github/symfony-cmf/resource?branch=master
[coveralls_stable_badge]: https://coveralls.io/repos/github/symfony-cmf/resource/badge.svg?branch=master
[coveralls_stable_link]: https://coveralls.io/github/symfony-cmf/resource?branch=master
[coveralls_unstable_badge]: https://coveralls.io/repos/github/symfony-cmf/resource/badge.svg?branch=master
[coveralls_unstable_link]: https://coveralls.io/github/symfony-cmf/resource?branch=master
10 changes: 9 additions & 1 deletion puli/AbstractRepository.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
<?php

/*
* This file is part of the Symfony CMF package.
*
* (c) 2011-2017 Symfony CMF
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/

namespace Symfony\Cmf\Component\Resource\Puli;

use Symfony\Cmf\Component\Resource\Puli\Api\ResourceRepository;
use Symfony\Cmf\Component\Resource\Puli\Api\ResourceNotFoundException;
use Webmozart\Assert\Assert;
use Webmozart\PathUtil\Path;

Expand Down
30 changes: 13 additions & 17 deletions puli/Api/PuliResource.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
<?php

/*
* This file is part of the Symfony CMF package.
*
* (c) 2011-2016 Symfony CMF
*
* Most of this file is directly copied from the puli/repository package.
* This file is part of the Symfony CMF package.
*
* (c) Bernhard Schussek <[email protected]>
* (c) 2011-2017 Symfony CMF
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
Expand Down Expand Up @@ -88,30 +84,30 @@ public function getChild($relPath);
/**
* Returns whether the child resource with the given relative path exists.
*
* @param string $relPath The relative resource path.
* @param string $relPath the relative resource path
*
* @return bool Whether a resource with the given path exists.
* @return bool whether a resource with the given path exists
*/
public function hasChild($relPath);

/**
* Returns whether the resource has child resources.
*
* @return bool Returns `true` if the resource has child resources.
* @return bool returns `true` if the resource has child resources
*/
public function hasChildren();

/**
* Lists the child resources of the resources.
*
* @return ResourceCollection The child resources indexed by their names.
* @return ResourceCollection the child resources indexed by their names
*/
public function listChildren();

/**
* Returns metadata about a resource.
*
* @return ResourceMetadata The resource metadata.
* @return ResourceMetadata the resource metadata
*/
public function getMetadata();

Expand Down Expand Up @@ -157,7 +153,7 @@ public function getRepositoryPath();
* $resource->attachTo($repo, '/path/in/repo');
* ```
*
* @param ResourceRepository $repo The repository.
* @param ResourceRepository $repo the repository
* @param string|null $path The path of the resource in the
* repository. If not passed, the resource
* will be attached to it current path.
Expand All @@ -181,7 +177,7 @@ public function detach();
* Resources can be attached to a repository with {@link attachTo()}. The
* method {@link getRepository()} returns the attached repository.
*
* @return bool Whether the resource is attached to a repository.
* @return bool whether the resource is attached to a repository
*/
public function isAttached();

Expand All @@ -205,9 +201,9 @@ public function isAttached();
*
* Use {@link isReference()} to find out whether a resource is a reference.
*
* @param string $path The path of the reference.
* @param string $path the path of the reference
*
* @return static The reference.
* @return static the reference
*/
public function createReference($path);

Expand All @@ -216,7 +212,7 @@ public function createReference($path);
*
* References are created by calling {@link createReference()}.
*
* @return bool Whether the resource is a reference.
* @return bool whether the resource is a reference
*/
public function isReference();
}
Loading

0 comments on commit edbe0c7

Please sign in to comment.