Skip to content

Commit

Permalink
use protected instead of private to make overriding services easier
Browse files Browse the repository at this point in the history
  • Loading branch information
k3ssen committed Apr 5, 2021
1 parent e1fd7d4 commit e1a1cca
Show file tree
Hide file tree
Showing 10 changed files with 24 additions and 26 deletions.
8 changes: 4 additions & 4 deletions Command/SymfonyVuetifiedSetupCommand.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);

namespace K3ssen\SymfonyVuetified\Command;

Expand All @@ -13,10 +14,11 @@ class SymfonyVuetifiedSetupCommand extends Command
{
protected static $defaultName = 'symfony-vuetified:setup';
protected static $defaultDescription = 'Adds/modifies required files/settings for setup SymfonyVuetified';

/**
* @var string
*/
private $rootDir;
protected $rootDir;

public function __construct(string $rootDir)
{
Expand All @@ -26,9 +28,7 @@ public function __construct(string $rootDir)

protected function configure()
{
$this
->setDescription(self::$defaultDescription)
;
$this->setDescription(self::$defaultDescription);
}

protected function execute(InputInterface $input, OutputInterface $output): int
Expand Down
4 changes: 3 additions & 1 deletion Maker/Generator.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php
declare(strict_types=1);

namespace K3ssen\SymfonyVuetified\Maker;

Expand All @@ -18,7 +19,8 @@ public function __construct(BaseGenerator $generator)
);
}

private function getProp(BaseGenerator $generator, string $propertyName) {
protected function getProp(BaseGenerator $generator, string $propertyName)
{
$reflectionProperty = new \ReflectionProperty($generator, $propertyName);
$reflectionProperty->setAccessible(true);
return $reflectionProperty->getValue($generator);
Expand Down
3 changes: 1 addition & 2 deletions Resources/assets/components/Form/SvCollection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ import {Component, Mixins, Prop} from 'vue-property-decorator';
collectionErrorMessage!: string;
@Prop({type: String, default: 'There are no items in this collection.'})
noItemsText!: string;
@Prop({type: Boolean, default: false})
verticalTabs!: boolean;
Expand Down Expand Up @@ -86,7 +85,7 @@ import {Component, Mixins, Prop} from 'vue-property-decorator';
(this.form.children as IForm[]).splice(key, 1);
}
public hasError(form: any) {
hasError(form: any) {
if (form.vars.errors) {
return true;
}
Expand Down
4 changes: 2 additions & 2 deletions Resources/assets/components/Form/SvForm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@
return null;
}
public mounted() {
mounted() {
this.setRemainingErrors(this.form);
}
public setRemainingErrors(form: any) {
setRemainingErrors(form: any) {
if (!form.rendered && form.vars.errors) {
this.remainingErrors.push({
label: form !== this.form ? form.vars?.label || form.vars.name : null,
Expand Down
4 changes: 2 additions & 2 deletions Resources/assets/components/SvApp.vue
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
@Component
export default class SvApp extends Vue {
@Prop({default: 'Application'})
public title!: string;
title!: string;
private drawer: boolean = true;
drawer: boolean = true;
};
</script>
10 changes: 5 additions & 5 deletions Resources/assets/components/SvFetch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ import {Vue, Prop, Component, Watch} from 'vue-property-decorator';
@Component
export default class SvFetch extends Vue {
@Prop()
public url!: string;
url!: string;
@Prop({default: 'vue', type: String})
public vueObjectName!: any;
vueObjectName!: any;
@Prop({default: 'vueData', type: String})
public dataObjectName!: any;
dataObjectName!: any;
@Prop({default: 'vueStoreData', type: String})
public storeDataObjectName!: any;
storeDataObjectName!: any;
private component: any = null;
component: any = null;
async mounted() {
await this.load();
Expand Down
4 changes: 2 additions & 2 deletions Resources/assets/components/SvMenuItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
@Component
export default class SvMenuItem extends Vue {
@Prop({default: null})
public href!: string;
href!: string;
@Prop({default: ''})
public icon!: string;
icon!: string;
}
</script>
5 changes: 1 addition & 4 deletions Resources/assets/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,5 @@
"allowSyntheticDefaultImports": true,
"sourceMap": true,
"types": ["vuetify"]
},
"exclude": [
"node_modules"
]
}
}
2 changes: 1 addition & 1 deletion Vue/VueExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class VueExtension extends AbstractExtension
/**
* @var VueDataStorage
*/
private $vueDataStorage;
protected $vueDataStorage;

public function __construct(VueDataStorage $vueDataStorage)
{
Expand Down
6 changes: 3 additions & 3 deletions Vue/VueForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ class VueForm implements \JsonSerializable
/**
* @var array
*/
private $vars;
protected $vars;

/** @var VueForm[] */
private $children = [];
protected $children = [];

public static function create(FormInterface $form): self
{
Expand Down Expand Up @@ -63,7 +63,7 @@ public function jsonSerialize()
];
}

private function addMappedBlockPrefixes()
protected function addMappedBlockPrefixes()
{
$initialPrefixes = $this->vars['block_prefixes'];
foreach ($initialPrefixes as $index => $block_prefix) {
Expand Down

0 comments on commit e1a1cca

Please sign in to comment.