Skip to content

Commit

Permalink
Merge branch 'release/0.5.7'
Browse files Browse the repository at this point in the history
  • Loading branch information
eliashaeussler committed Oct 24, 2023
2 parents 8cb6031 + 76fadb8 commit a72d62b
Show file tree
Hide file tree
Showing 10 changed files with 394 additions and 444 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cgl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
# Install dependencies
- name: Install Composer dependencies
run: |
composer require --no-progress --no-plugins brotkrueml/schema:"^2.7"
composer require --no-progress --no-plugins brotkrueml/schema:"^2.7 || ^3.0"
# Check Composer dependencies
- name: Check dependencies
Expand Down
4 changes: 2 additions & 2 deletions Classes/Command/ImportCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,10 @@ private function printResult(ImportResult $result): void
}

// Sort jobs by personio id
usort($jobs, static fn (Job $a, Job $b) => $a->getPersonioId() <=> $b->getPersonioId());
usort($jobs, static fn(Job $a, Job $b) => $a->getPersonioId() <=> $b->getPersonioId());

// Add job to table
$table->addRows(array_map(static fn (Job $job) => self::decorateTableRow($job, $importOperation), $jobs));
$table->addRows(array_map(static fn(Job $job) => self::decorateTableRow($job, $importOperation), $jobs));

$rowsAdded = true;
}
Expand Down
15 changes: 13 additions & 2 deletions Classes/Domain/Factory/SchemaFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
use Psr\EventDispatcher\EventDispatcherInterface;
use TYPO3\CMS\Core\Information\Typo3Version;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;

/**
Expand Down Expand Up @@ -69,8 +70,18 @@ public function createJobPosting(Job $job): JobPosting
$organizationType = $this->createOrganization($job);
$placeType = $this->createPlace($job);

/** @var JobPosting $jobPosting */
$jobPosting = TypeFactory::createType('JobPosting')
// Create job posting
if (method_exists(TypeFactory::class, 'create')) {
// @todo Use DI once support for EXT:schema v2 is dropped
$jobPosting = GeneralUtility::makeInstance(TypeFactory::class)->create('JobPosting');
} else {
// @todo Remove once support for EXT:schema v2 is dropped
$jobPosting = TypeFactory::createType('JobPosting');
}

\assert($jobPosting instanceof JobPosting);

$jobPosting
->setProperty('datePosted', ($job->getCreateDate() ?? new DateTime())->format('Y-m-d'))
->setProperty('employmentType', $this->decorateEmploymentType($job))
->setProperty('hiringOrganization', $organizationType)
Expand Down
2 changes: 1 addition & 1 deletion Classes/Domain/Repository/JobRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public function findOrphans(array $existingJobs, int $storagePid = null): QueryR
$query->logicalNot(
$query->in(
'personioId',
array_map(static fn (Job $job) => $job->getPersonioId(), $existingJobs),
array_map(static fn(Job $job) => $job->getPersonioId(), $existingJobs),
),
),
);
Expand Down
2 changes: 1 addition & 1 deletion Classes/Mapper/Source/XmlSource.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function __construct(array $source)
*/
public static function fromXml(string $xml): self
{
set_error_handler(static fn (int $code, string $message) => self::handleParseError($xml, $message));
set_error_handler(static fn(int $code, string $message) => self::handleParseError($xml, $message));

try {
$source = XmlToArray::convert($xml);
Expand Down
12 changes: 6 additions & 6 deletions Resources/Private/Libs/Build/composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
},
"require-dev": {
"armin/editorconfig-cli": "^1.5",
"brotkrueml/schema": "^2.7",
"brotkrueml/schema": "^2.7 || ^3.0",
"ergebnis/composer-normalize": "^2.29",
"helmich/typo3-typoscript-lint": "^3.0",
"phpstan/extension-installer": "^1.2",
Expand Down Expand Up @@ -58,9 +58,9 @@
"config": {
"allow-plugins": {
"ergebnis/composer-normalize": true,
"typo3/cms-composer-installers": true,
"phpstan/extension-installer": true,
"typo3/class-alias-loader": true,
"phpstan/extension-installer": true
"typo3/cms-composer-installers": true
},
"bin-dir": ".Build/bin",
"sort-packages": true,
Expand Down
Loading

0 comments on commit a72d62b

Please sign in to comment.