Skip to content

Commit

Permalink
make options use underscores instead of camelCase names
Browse files Browse the repository at this point in the history
  • Loading branch information
Maarten de Waard committed Nov 20, 2017
1 parent c16bde5 commit 4149bff
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 22 deletions.
16 changes: 8 additions & 8 deletions README.md
Expand Up @@ -12,7 +12,7 @@ Just look at [**ApiGen API**](https://apigen.github.io/ApiGen):

![ApiGen Preview](docs/preview.png)

## Your Help is Needed to Finish 5.x Release
## Your Help is Needed to Finish 5.x Release

:heart: We need your help to test new version of ApiGen.

Expand Down Expand Up @@ -78,10 +78,10 @@ the root of your project:

```yaml
parameters:
visibilityLevels: [public, protected] # array
annotationGroups: [todo, deprecated] # array
visibility_levels: [public, protected] # array
annotation_groups: [todo, deprecated] # array
title: "ApiGen Docs" # string
baseUrl: "http://apigen.org/api" # string
base_url: "http://apigen.org/api" # string
overwrite: false # bool
```

Expand Down Expand Up @@ -121,18 +121,18 @@ A website url.
```php
/**
* This is already mentioned on Wiki.
* @link https://en.wikipedia.org/wiki/United_we_stand,_divided_we_fall Click to see a cool quote
* @link https://en.wikipedia.org/wiki/United_we_stand,_divided_we_fall Click to see a cool quote
*/
```

**Generated**

```html
This is already mentioned on Wiki.
@link <a href="https://en.wikipedia.org/wiki/United_we_stand,_divided_we_fall">Click to see a cool quote</a>
@link <a href="https://en.wikipedia.org/wiki/United_we_stand,_divided_we_fall">Click to see a cool quote</a>
```

### `@internal`
### `@internal`

Associated element is internal, so ApiGen hides it.

Expand All @@ -143,7 +143,7 @@ To enable a custom theme just provide `themeDirectory` configuration option in y

```yaml
parameters:
themeDirectory: path/to/theme # path to theme's config file
theme_directory: path/to/theme # path to theme's config file
```

## Contributing
Expand Down
Expand Up @@ -9,7 +9,7 @@ final class AnnotationGroupsOption implements OptionInterface
/**
* @var string
*/
public const NAME = 'annotationGroups';
public const NAME = 'annotation_groups';

public function getName(): string
{
Expand Down
2 changes: 1 addition & 1 deletion packages/ModularConfiguration/src/Option/BaseUrlOption.php
Expand Up @@ -9,7 +9,7 @@ final class BaseUrlOption implements OptionInterface
/**
* @var string
*/
public const NAME = 'baseUrl';
public const NAME = 'base_url';

public function getName(): string
{
Expand Down
Expand Up @@ -11,7 +11,7 @@ final class ThemeDirectoryOption implements OptionInterface
/**
* @var string
*/
public const NAME = 'themeDirectory';
public const NAME = 'theme_directory';

/**
* @var FileSystem
Expand Down
Expand Up @@ -10,7 +10,7 @@ final class VisibilityLevelOption implements OptionInterface
/**
* @var string
*/
public const NAME = 'visibilityLevels';
public const NAME = 'visibility_levels';

/**
* @var string
Expand Down
10 changes: 0 additions & 10 deletions src/Configuration/Configuration.php
Expand Up @@ -49,16 +49,6 @@ public function resolveOptions(array $options): array

$resolvedOptions = $this->configurationResolver->resolveValuesWithDefaults($options);

// hack to remove duplicated lowercased value
unset($resolvedOptions[strtolower(VisibilityLevelOption::NAME)]);

$baseUrlKeyLowered = strtolower(BaseUrlOption::NAME);
if (isset($resolvedOptions[$baseUrlKeyLowered])) {
$resolvedOptions[BaseUrlOption::NAME] = $resolvedOptions[$baseUrlKeyLowered];
}

unset($resolvedOptions[$baseUrlKeyLowered]);

return $this->options = $resolvedOptions;
}

Expand Down

0 comments on commit 4149bff

Please sign in to comment.