Skip to content

Commit ee12cdf

Browse files
Fix CS, add circleci config
1 parent 2f74971 commit ee12cdf

File tree

2 files changed

+43
-6
lines changed

2 files changed

+43
-6
lines changed

.circleci/config.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# PHP CircleCI 2.0 configuration file
2+
#
3+
# Check https://circleci.com/docs/2.0/language-php/ for more details
4+
#
5+
version: 2
6+
jobs:
7+
build:
8+
docker:
9+
# Specify the version you desire here
10+
- image: circleci/php:7.1-node-browsers
11+
12+
steps:
13+
- checkout
14+
15+
- run: sudo apt update # PHP CircleCI 2.0 Configuration File# PHP CircleCI 2.0 Configuration File sudo apt install zlib1g-dev libsqlite3-dev
16+
- run: sudo docker-php-ext-install zip
17+
18+
# Download and cache dependencies
19+
- restore_cache:
20+
keys:
21+
# "composer.lock" can be used if it is committed to the repo
22+
- v1-dependencies-{{ checksum "composer.json" }}
23+
# fallback to using the latest cache if no exact match is found
24+
- v1-dependencies-
25+
26+
- run: composer install -n --prefer-dist
27+
28+
- save_cache:
29+
key: v1-dependencies-{{ checksum "composer.json" }}
30+
paths:
31+
- ./vendor
32+
33+
# run tests with phpunit
34+
- run: ./vendor/bin/phpunit
35+
- run: ./vendor/bin/phpcs --standard=PSR2 src/
36+
- run: php tests/CoverageCheck.php tests/clover.xml 95
37+

src/Model.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class Model extends EloquentModel
2525
protected $parentCollection = null;
2626

2727

28-
private function shouldAutoLoad()
28+
private function shouldAutoLoad(): bool
2929
{
3030
return ($this->parentCollection
3131
&& count($this->parentCollection) > 1
@@ -44,12 +44,12 @@ public function getRelationshipFromMethod($method)
4444

4545
$relations = $this->$method();
4646
if (!$relations instanceof Relation) {
47-
throw new LogicException(sprintf(
48-
'%s::%s must return a relationship instance.', static::class, $method
49-
));
47+
throw new LogicException(
48+
sprintf('%s::%s must return a relationship instance.', static::class, $method)
49+
);
5050
}
5151

52-
if ($this->shouldAutoLoad()) {
52+
if ($this->shouldAutoLoad()) {
5353
$this->parentCollection->loadMissing($method);
5454
}
5555
return $this->$method()->getResults();
@@ -82,4 +82,4 @@ public function disableAutoload(): Model
8282
$this->autoloadThreshold = 0;
8383
return $this;
8484
}
85-
}
85+
}

0 commit comments

Comments
 (0)