Skip to content

Commit 5bcf13a

Browse files
authored
Merge pull request #1 from pronkoconsulting/coding-standards
Updated coding standards
2 parents 96e97e2 + 3d36dd3 commit 5bcf13a

3 files changed

Lines changed: 33 additions & 8 deletions

File tree

ViewModel/Videos.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,16 @@ class Videos implements ArgumentInterface
4040
public function __construct(
4141
Json $serializer,
4242
Curl $curl,
43-
$videosIds = []
43+
array $videosIds = []
4444
) {
4545
$this->serializer = $serializer;
4646
$this->curl = $curl;
4747
$this->videosIds = $videosIds;
4848
}
4949

5050
/**
51+
* Get video data
52+
*
5153
* @param int $videoId
5254
* @return mixed
5355
*/
@@ -69,7 +71,9 @@ private function getVideoData($videoId)
6971
}
7072

7173
/**
72-
* @param $duration
74+
* Formats duration of a video
75+
*
76+
* @param int $duration
7377
* @return string
7478
*/
7579
private function formatDuration($duration)
@@ -78,6 +82,8 @@ private function formatDuration($duration)
7882
}
7983

8084
/**
85+
* Get videos data in a json format
86+
*
8187
* @return bool|string
8288
*/
8389
public function getVideosDataJson()

composer.json

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"name": "pronko/get-started-videos",
33
"description": "Learn Magento 2 management from admin",
44
"type": "magento2-module",
5-
"version": "1.0.0",
65
"license": "proprietary",
76
"authors": [
87
{
@@ -26,5 +25,21 @@
2625
"psr-4": {
2726
"Pronko\\GetStartedVideos\\": ""
2827
}
28+
},
29+
"config": {
30+
"allow-plugins": {
31+
"magento/composer-dependency-version-audit-plugin": true
32+
}
33+
},
34+
"require-dev": {
35+
"magento/magento-coding-standard": "^26.0"
36+
},
37+
"scripts": {
38+
"post-install-cmd": [
39+
"([ $COMPOSER_DEV_MODE -eq 0 ] || vendor/bin/phpcs --config-set installed_paths ../../magento/magento-coding-standard/)"
40+
],
41+
"post-update-cmd": [
42+
"([ $COMPOSER_DEV_MODE -eq 0 ] || vendor/bin/phpcs --config-set installed_paths ../../magento/magento-coding-standard/)"
43+
]
2944
}
30-
}
45+
}

view/adminhtml/templates/get_started.phtml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,11 @@ $videosJsonData = $viewModel->getVideosDataJson();
3838
<h3 data-bind="text: video.title"></h3>
3939
</div>
4040
<div class="video-container">
41-
<iframe class="video-frame" data-bind="attr:{src: video.url}" width="600" height="300" frameborder="0" allowfullscreen></iframe>
41+
<iframe class="video-frame"
42+
data-bind="attr:{src: video.url}"
43+
width="600"
44+
height="300" frameborder="0"
45+
allowfullscreen></iframe>
4246
</div>
4347
</div>
4448
<!--/ko-->
@@ -50,14 +54,14 @@ $videosJsonData = $viewModel->getVideosDataJson();
5054
"components": {
5155
"get-started-component": {
5256
"component": "Pronko_GetStartedVideos/js/get-started-component",
53-
"videosData": <?= $videosJsonData ?>
57+
"videosData": <?= /** @noEscape */ $videosJsonData ?>
5458
},
5559
"video-modal-component": {
5660
"component": "Pronko_GetStartedVideos/js/video-modal-component",
57-
"videosData": <?= $videosJsonData ?>
61+
"videosData": <?= /** @noEscape */ $videosJsonData ?>
5862
}
5963
}
6064
}
6165
}
6266
}
63-
</script>
67+
</script>

0 commit comments

Comments
 (0)