Skip to content

Commit

Permalink
DevKit updates for 4.x branch (#1494)
Browse files Browse the repository at this point in the history
* DevKit updates

* Fix for phpstan

Co-authored-by: Vincent Langlet <vincentlanglet@hotmail.fr>
  • Loading branch information
SonataCI and VincentLanglet committed Aug 11, 2021
1 parent 8f7c4ae commit 10cf394
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 172 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
*.md export-ignore
tests export-ignore
docs export-ignore
.readthedocs.yaml export-ignore
Makefile export-ignore
phpunit.xml.dist export-ignore
phpstan.neon.dist export-ignore
Expand Down
10 changes: 10 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2

sphinx:
builder: dirhtml
configuration: docs/conf.py

python:
version: '3.7'
install:
- requirements: docs/requirements.txt
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ endif
.PHONY: test

docs:
cd docs && sphinx-build -W -b html -d _build/doctrees . _build/html
cd docs && sphinx-build -W -b dirhtml -d _build/doctrees . _build/html
.PHONY: docs

phpstan:
Expand Down
15 changes: 10 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ Integrate Doctrine ORM into the SonataAdminBundle
[![Monthly Downloads](https://poser.pugx.org/sonata-project/doctrine-orm-admin-bundle/d/monthly)](https://packagist.org/packages/sonata-project/doctrine-orm-admin-bundle)
[![Daily Downloads](https://poser.pugx.org/sonata-project/doctrine-orm-admin-bundle/d/daily)](https://packagist.org/packages/sonata-project/doctrine-orm-admin-bundle)

Branch | Github Actions | Code Coverage |
------ | -------------- | ------------- |
4.x | [![Test][test_stable_badge]][test_stable_link] | [![Coverage Status][coverage_stable_badge]][coverage_stable_link] |
master | [![Test][test_unstable_badge]][test_unstable_link] | [![Coverage Status][coverage_unstable_badge]][coverage_unstable_link] |
Branch | Github Actions | Code Coverage | Documentation |
------ | -------------- | ------------- | ------------- |
4.x | [![Test][test_stable_badge]][test_stable_link] | [![Coverage Status][coverage_stable_badge]][coverage_stable_link] | [![Documentation Status][documentation_stable_badge]][documentation_stable_link] |
master | [![Test][test_unstable_badge]][test_unstable_link] | [![Coverage Status][coverage_unstable_badge]][coverage_unstable_link] | [![Documentation Status][documentation_unstable_badge]][documentation_unstable_link] |

## Documentation

Check out the documentation on the [official website](https://sonata-project.org/bundles/doctrine-orm-admin).
Check out the documentation on the [official website](https://docs.sonata-project.org/projects/SonataDoctrineORMAdminBundle).

## Support

Expand All @@ -48,3 +48,8 @@ This package is available under the [MIT license](LICENSE).
[coverage_unstable_link]: https://codecov.io/gh/sonata-project/SonataDoctrineORMAdminBundle/branch/master
[shepherd_stable_badge]: https://shepherd.dev/github/sonata-project/SonataDoctrineORMAdminBundle/coverage.svg
[shepherd_stable_link]: https://shepherd.dev/github/sonata-project/SonataDoctrineORMAdminBundle

[documentation_stable_badge]: https://readthedocs.org/projects/sonata-project-doctrineormadminbundle/badge/?version=4.x
[documentation_stable_link]: https://docs.sonata-project.org/projects/SonataDoctrineORMAdminBundle/en/4.x/?badge=4.x
[documentation_unstable_badge]: https://readthedocs.org/projects/sonata-project-doctrineormadminbundle/badge/?version=master
[documentation_unstable_link]: https://docs.readthedocs.org/projects/SonataDoctrineORMAdminBundle/en/master/?badge=master
153 changes: 0 additions & 153 deletions docs/Makefile

This file was deleted.

10 changes: 7 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,13 @@
# -- General configuration -----------------------------------------------------

# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.0'
needs_sphinx = '1.8.5'

# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = ['sensio.sphinx.configurationblock', 'sensio.sphinx.phpcode']
extensions = [
'sensio.sphinx.codeblock', 'sensio.sphinx.configurationblock', 'sensio.sphinx.phpcode'
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
Expand All @@ -49,7 +51,7 @@

# General information about the project.
project = u'SonataDoctrineOrmAdminBundle'
copyright = u'2010-2020, Thomas Rabaix'
copyright = u'2010-2021, Thomas Rabaix'

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand Down Expand Up @@ -102,7 +104,9 @@
# enable highlighting for PHP code not between ``<?php ... ?>`` by default
lexers['php'] = PhpLexer(startinline=True)
lexers['php-annotations'] = PhpLexer(startinline=True)
lexers['php-attributes'] = PhpLexer(startinline=True)
lexers['php-standalone'] = PhpLexer(startinline=True)
lexers['php-symfony'] = PhpLexer(startinline=True)

# -- Options for HTML output ---------------------------------------------------
import sphinx_rtd_theme
Expand Down
7 changes: 4 additions & 3 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#
# It's auto-generated by sonata-project/dev-kit package.

Sphinx==1.8.5
git+https://github.com/fabpot/sphinx-php.git
sphinx_rtd_theme
Pygments==2.2.0
sphinx==1.8.5
git+https://github.com/fabpot/sphinx-php.git@v2.0.2#egg_name=sphinx-php
sphinx_rtd_theme==0.5.2
12 changes: 5 additions & 7 deletions src/FieldDescription/FieldDescriptionFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,13 @@ private function getParentMetadataForProperty(string $baseClass, string $propert

foreach ($nameElements as $nameElement) {
$metadata = $this->getMetadata($class);

if (isset($metadata->associationMappings[$nameElement])) {
$parentAssociationMappings[] = $metadata->associationMappings[$nameElement];
$class = $metadata->getAssociationTargetClass($nameElement);

continue;
if (!isset($metadata->associationMappings[$nameElement])) {
break;
}

break;
$parentAssociationMappings[] = $metadata->associationMappings[$nameElement];
$class = $metadata->getAssociationTargetClass($nameElement);
\assert(null !== $class); // https://github.com/doctrine/persistence/pull/192
}

$properties = \array_slice($nameElements, \count($parentAssociationMappings));
Expand Down

0 comments on commit 10cf394

Please sign in to comment.