Skip to content

Commit 376eada

Browse files
authored
Merge pull request #331 from MGatner/tatter/patches
2 parents 2bb515b + ade156d commit 376eada

File tree

5 files changed

+30
-19
lines changed

5 files changed

+30
-19
lines changed

app/Common.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* The goal of this file is to allow developers a location
55
* where they can overwrite core procedural functions and
66
* replace them with their own. This file is loaded during
7-
* the bootstrap process and is called during the frameworks
7+
* the bootstrap process and is called during the framework's
88
* execution.
99
*
1010
* This can be looked at as a `master helper` file that is

app/Entities/GitHub/Release.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@
1414
*
1515
* @property string $author
1616
* @property Time $created_at
17-
* @property URI $download_url
17+
* @property URI|null $download_url
1818
* @property int|string $id
1919
* @property string $name
2020
* @property bool $prerelease
2121
* @property string $tag
22-
* @property URI $url
22+
* @property URI|null $url
2323
*/
2424
class Release extends Entity
2525
{

app/Libraries/Blog.php

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ public function __construct()
3535
* subfolder of that name.
3636
*
3737
* @throws BlogException
38+
*
39+
* @return Post[]
3840
*/
3941
public function getRecentPosts(int $limit = 5, int $offset = 0, ?string $category = null)
4042
{
@@ -134,6 +136,8 @@ public function getPopularPosts(int $limit = 5)
134136

135137
/**
136138
* Gets a single post
139+
*
140+
* @return Post|null
137141
*/
138142
public function getPost(string $slug)
139143
{
@@ -142,7 +146,7 @@ public function getPost(string $slug)
142146
if (! $post = cache($cacheKey)) {
143147
$files = glob("{$this->config->contentPath}*.{$slug}.md");
144148

145-
if (! (is_countable($files) ? count($files) : 0)) {
149+
if (empty($files)) {
146150
throw PageNotFoundException::forPageNotFound();
147151
}
148152

@@ -185,7 +189,7 @@ public function recentPostsWidget(int $limit, string $view = 'blog/_widget'): st
185189
{
186190
$posts = $this->getRecentPosts($limit);
187191

188-
if (! (is_countable($posts) ? count($posts) : 0)) {
192+
if ($posts === []) {
189193
return '';
190194
}
191195

@@ -203,7 +207,7 @@ public function popularPostsWidget(int $limit): string
203207
{
204208
$posts = $this->getPopularPosts($limit);
205209

206-
if (! (is_countable($posts) ? count($posts) : 0)) {
210+
if (is_countable($posts) ? count($posts) : 0) {
207211
return '';
208212
}
209213

@@ -216,6 +220,8 @@ public function popularPostsWidget(int $limit): string
216220
/**
217221
* Reads in a post from file and parses it
218222
* into a Post Entity.
223+
*
224+
* @return Post|null
219225
*/
220226
protected function readPost(string $folder, string $filename)
221227
{
@@ -230,7 +236,7 @@ protected function readPost(string $folder, string $filename)
230236
// Get slug and date
231237
preg_match('|^([\d-]+).(\S+).md$|i', $filename, $matches);
232238

233-
if (! count($matches)) {
239+
if ($matches === []) {
234240
return null;
235241
}
236242

@@ -289,7 +295,7 @@ protected function parseVideoTags(?string $html = null)
289295
// ![[ https://youtube.com/watch?v=xlkjsdfhlk ]]
290296
preg_match_all('|!video\[([\s\w:/.?=&;]*)\]|i', $html, $matches);
291297

292-
if (! count($matches)) {
298+
if ($matches === []) {
293299
return $html;
294300
}
295301

app/Views/errors/html/error_exception.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@
270270

271271
<?php endif; ?>
272272

273-
<?php $headers = $request->getHeaders(); ?>
273+
<?php $headers = $request->headers(); ?>
274274
<?php if (! empty($headers)) : ?>
275275

276276
<h3>Headers</h3>
@@ -318,7 +318,7 @@
318318
</tr>
319319
</table>
320320

321-
<?php $headers = $response->getHeaders(); ?>
321+
<?php $headers = $response->headers(); ?>
322322
<?php if (! empty($headers)) : ?>
323323
<?php natsort($headers) ?>
324324

composer.lock

Lines changed: 14 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)