Skip to content

Commit

Permalink
Merge pull request #46 from ujamii/feature/nette-code-generator
Browse files Browse the repository at this point in the history
Feature/nette code generator
  • Loading branch information
mgrundkoetter authored Mar 14, 2022
2 parents e2bcbac + cfe249f commit 042ea07
Show file tree
Hide file tree
Showing 141 changed files with 5,767 additions and 14,329 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# OpenImmo PHP library

[![Packagist](https://img.shields.io/packagist/v/ujamii/openimmo.svg?colorB=green&style=flat)](https://packagist.org/packages/ujamii/openimmo)
[![Minimum PHP Version](https://img.shields.io/badge/php-7.3%2B-8892BF.svg?style=flat)](https://php.net/)
[![Minimum PHP Version](https://img.shields.io/badge/php-7.4%2B-8892BF.svg?style=flat)](https://php.net/)
[![Continuous Integration](https://github.com/ujamii/openimmo/actions/workflows/php.yml/badge.svg)](https://github.com/ujamii/openimmo/actions)
[![codecov](https://codecov.io/gh/ujamii/openimmo/branch/master/graph/badge.svg?token=97D799UX1B)](https://codecov.io/gh/ujamii/openimmo)
[![Mutation testing badge](https://img.shields.io/endpoint?style=flat&url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Fujamii%2Fopenimmo%2Fmaster)](https://dashboard.stryker-mutator.io/reports/github.com/ujamii/openimmo/master)
Expand Down
15 changes: 0 additions & 15 deletions build/config/phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,6 @@ parameters:
count: 2
path: ../../src/Generator/ApiGenerator.php

-
message: "#^Call to an undefined method GoetasWebservices\\\\XML\\\\XSDReader\\\\Schema\\\\Element\\\\ElementItem\\:\\:getMax\\(\\)\\.$#"
count: 1
path: ../../src/Generator/ApiGenerator.php

-
message: "#^Call to an undefined method GoetasWebservices\\\\XML\\\\XSDReader\\\\Schema\\\\Element\\\\ElementItem\\:\\:getType\\(\\)\\.$#"
count: 2
path: ../../src/Generator/ApiGenerator.php

-
message: "#^Call to an undefined method GoetasWebservices\\\\XML\\\\XSDReader\\\\Schema\\\\Element\\\\ElementItem\\:\\:getMin\\(\\)\\.$#"
count: 1
path: ../../src/Generator/ApiGenerator.php

-
message: "#^Call to an undefined method GoetasWebservices\\\\XML\\\\XSDReader\\\\Schema\\\\Element\\\\ElementItem\\|GoetasWebservices\\\\XML\\\\XSDReader\\\\Schema\\\\Item\\:\\:getMax\\(\\)\\.$#"
count: 1
Expand Down
44 changes: 16 additions & 28 deletions build/config/phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -1,30 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>

<phpunit backupGlobals="false"
backupStaticAttributes="false"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
cacheResultFile="../cache/.phpunit.result.cache"
bootstrap="../../vendor/autoload.php"
>
<testsuites>
<testsuite name="Code Generator Test Suite">
<directory>../../tests/</directory>
</testsuite>
</testsuites>

<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">../../src/</directory>
</whitelist>
</filter>

<logging>
<log type="coverage-html" target="../coverage/coverage-html"/>
<log type="coverage-clover" target="../coverage/clover.xml"/>
</logging>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" backupStaticAttributes="false" colors="true" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" cacheResultFile="../cache/.phpunit.result.cache" bootstrap="../../vendor/autoload.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">../../src/</directory>
</include>
<report>
<clover outputFile="../coverage/clover.xml"/>
<html outputDirectory="../coverage/coverage-html"/>
</report>
</coverage>
<testsuites>
<testsuite name="Code Generator Test Suite">
<directory>../../tests/</directory>
</testsuite>
</testsuites>
<logging/>
</phpunit>
18 changes: 11 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@
"require-dev": {
"ext-json": "*",
"goetas-webservices/xsd-reader": "^0.3",
"gossi/php-code-generator": "dev-prevent-fatal-error",
"phpunit/phpunit": ">=7.5",
"phpstan/phpstan": "^0.12",
"phpstan/phpstan": "^1.0",
"infection/infection": ">=0.16",
"friendsofphp/php-cs-fixer": "^2.18 || ^3.0",
"rector/rector": "^0.9.31 || ^0.11.0",
"symfony/serializer": "^5.3"
"rector/rector": ">=0.9",
"symfony/serializer": "^5.3",
"nette/php-generator": "^3.6 || ^4.0"
},
"minimum-stability": "dev",
"prefer-stable": true,
Expand All @@ -67,9 +67,7 @@
"phpstan": "vendor/bin/phpstan analyse -c build/config/phpstan.neon",
"rector": "vendor/bin/rector process src tests -c build/config/rector.php --xdebug",
"php-cs-fixer": "vendor/bin/php-cs-fixer fix --config build/config/cs.php",
"infection": [
"vendor/bin/infection --only-covered --configuration=./build/config/infection.json.dist --threads=8 --min-msi=99.9"
],
"infection": "vendor/bin/infection --only-covered --configuration=./build/config/infection.json.dist --threads=8 --min-msi=99",
"infection-rebuild": [
"@infection",
"@generate-api"
Expand All @@ -90,5 +88,11 @@
"infection": "Runs mutation testing, configured in build/config/infection.json.dist.",
"infection-rebuild": "Runs mutation testing and re-creates all API classes afterwards, as the folder gets wiped during mutation tests.",
"testall": "Runs the whole set of tests."
},
"config": {
"allow-plugins": {
"infection/extension-installer": true,
"cweagans/composer-patches": true
}
}
}
39 changes: 9 additions & 30 deletions src/API/Aktion.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,57 +10,36 @@
* Class Aktion
* Aktion für Objekt. Wenn nicht vorhanden, dann "ADD", als neu.
* Change= Update der Objektdaten, Delete = Löschen des Objektes
* Referenz= Die Möglichkeit Objekte in Portalen als „Verkauft“ oder „Archiv“ zu definieren.
*
* Referenz= Die Möglichkeit Objekte in Portalen als Verkauft oder Archiv zu definieren.
* @XmlRoot("aktion")
*/
class Aktion
{
/**
*/
public const AKTIONART_CHANGE = 'CHANGE';

/**
*/
public const AKTIONART_DELETE = 'DELETE';

/**
*/
public const AKTIONART_REFERENZ = 'REFERENZ';

/**
* optional
*
* @Type("string")
* @XmlAttribute
* optional
* @see AKTIONART_* constants
* @var string
*/
protected $aktionart;

/**
* @param string $aktionart Shortcut setter for aktionart
*/
public function __construct(string $aktionart = null)
{
$this->aktionart = $aktionart;
}
protected string $aktionart = '';

/**
* @return string
*/
public function getAktionart(): ?string
{
return $this->aktionart;
}

/**
* @param string $aktionart Setter for aktionart
* @return Aktion
*/
public function setAktionart(?string $aktionart)
public function setAktionart(?string $aktionart): Aktion
{
$this->aktionart = $aktionart;
return $this;
}

public function __construct(string $aktionart = '')
{
$this->aktionart = $aktionart;
}
}
34 changes: 8 additions & 26 deletions src/API/Alter.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,52 +9,34 @@
/**
* Class Alter
* Ist es ein Neu- oder Altbau, Optionen nicht kombinierbar
*
* @XmlRoot("alter")
*/
class Alter
{
/**
*/
public const ALTER_ATTR_ALTBAU = 'ALTBAU';

/**
*/
public const ALTER_ATTR_NEUBAU = 'NEUBAU';

/**
* optional
*
* @Type("string")
* @XmlAttribute
* optional
* @see ALTER_ATTR_* constants
* @var string
*/
protected $alterAttr;
protected string $alterAttr = '';

/**
* @param string $alterAttr Shortcut setter for alterAttr
*/
public function __construct(string $alterAttr = null)
{
$this->alterAttr = $alterAttr;
}

/**
* @return string
*/
public function getAlterAttr(): ?string
{
return $this->alterAttr;
}

/**
* @param string $alterAttr Setter for alterAttr
* @return Alter
*/
public function setAlterAttr(?string $alterAttr)
public function setAlterAttr(?string $alterAttr): Alter
{
$this->alterAttr = $alterAttr;
return $this;
}

public function __construct(string $alterAttr = '')
{
$this->alterAttr = $alterAttr;
}
}
Loading

0 comments on commit 042ea07

Please sign in to comment.