<commit_before><?php
/**
 * Audio Player
 *
 * This file is licensed under the Affero General Public License version 3 or
 * later. See the LICENSE.md file.
 *
 * @author <NAME> <<EMAIL>>
 * @copyright 2016-2018 <NAME>
 */

namespace OCA\audioplayer\Settings;

use OCP\AppFramework\Http\TemplateResponse;
use OCP\IURLGenerator;
use OCP\Settings\ISettings;
use OCP\IConfig;

class Personal implements ISettings
{

    private $userId;
    private $urlGenerator;
    private $configManager;

    public function __construct(
        $userId,
        IConfig $configManager,
        IURLGenerator $urlGenerator
    )
    {
        $this->userId = $userId;
        $this->configManager = $configManager;
        $this->urlGenerator = $urlGenerator;
    }

    /**
     * @return TemplateResponse returns the instance with all parameters set, ready to be rendered
     * @since 9.1
     */
    public function getForm()
    {

        $parameters = [
            'audioplayer_cyrillic' => $this->configManager->getUserValue($this->userId, 'audioplayer', 'cyrillic'),
            'audioplayer_path' => $this->configManager->getUserValue($this->userId, 'audioplayer', 'path'),
            'audioplayer_sonos' => $this->configManager->getUserValue($this->userId, 'audioplayer', 'sonos'),
            'audioplayer_sonos_controller' => $this->configManager->getUserValue($this->userId, 'audioplayer', 'sonos_controller'),
            'audioplayer_sonos_smb_path' => $this->configManager->getUserValue($this->userId, 'audioplayer', 'sonos_smb_path'),
        ];
        return new TemplateResponse('audioplayer', 'settings-personal', $parameters, '');
    }

    /**
     * @return string the section ID, e.g. 'sharing'
     * @since 9.1
     */
    public function getSection()
    {
        return 'audioplayer';
    }

    /**
     * @return int whether the form should be rather on the top or bottom of
     * the admin section. The forms are arranged in ascending order of the
     * priority values. It is required to return a value between 0 and 100.
     *
     * E.g.: 70
     * @since 9.1
     */
    public function getPriority()
    {
        return 40;
    }
}<commit_msg>OwnCloud 10 Settings page fails, this fixes it (#338)<commit_after><?php
/**
 * Audio Player
 *
 * This file is licensed under the Affero General Public License version 3 or
 * later. See the LICENSE.md file.
 *
 * @author <NAME> <<EMAIL>>
 * @copyright 2016-2018 <NAME>
 */

namespace OCA\audioplayer\Settings;

use OCP\AppFramework\Http\TemplateResponse;
use OCP\IURLGenerator;
use OCP\Settings\ISettings;
use OCP\IConfig;

class Personal implements ISettings
{

    private $userId;
    private $urlGenerator;
    private $configManager;

    public function __construct(
        $userId,
        IConfig $configManager,
        IURLGenerator $urlGenerator
    )
    {
        $this->userId = $userId;
        $this->configManager = $configManager;
        $this->urlGenerator = $urlGenerator;
    }

    /**
     * @return TemplateResponse returns the instance with all parameters set, ready to be rendered
     * @since 9.1
     */
    public function getForm()
    {

        $parameters = [
            'audioplayer_cyrillic' => $this->configManager->getUserValue($this->userId, 'audioplayer', 'cyrillic'),
            'audioplayer_path' => $this->configManager->getUserValue($this->userId, 'audioplayer', 'path'),
            'audioplayer_sonos' => $this->configManager->getUserValue($this->userId, 'audioplayer', 'sonos'),
            'audioplayer_sonos_controller' => $this->configManager->getUserValue($this->userId, 'audioplayer', 'sonos_controller'),
            'audioplayer_sonos_smb_path' => $this->configManager->getUserValue($this->userId, 'audioplayer', 'sonos_smb_path'),
        ];
        return new TemplateResponse('audioplayer', 'settings-personal', $parameters, '');
    }
    
   /**
     * Print config section (ownCloud 10)
     *
     * @return TemplateResponse
     */
    public function getPanel() {
        return $this->getForm();
    }

    /**
     * @return string the section ID, e.g. 'sharing'
     * @since 9.1
     */
    public function getSection()
    {
        return 'audioplayer';
    }

    /**
     * Get section ID (ownCloud 10)
     *
     * @return string
     */
    public function getSectionID() {
        $this->getSection();
    }
    
    /**
     * @return int whether the form should be rather on the top or bottom of
     * the admin section. The forms are arranged in ascending order of the
     * priority values. It is required to return a value between 0 and 100.
     *
     * E.g.: 70
     * @since 9.1
     */
    public function getPriority()
    {
        return 40;
    }
}
{'fraction_non_alphanumeric': 0.12248357702903158, 'fraction_numerical': 0.011655011655011656, 'mean_word_length': 2.6846213895394224, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 59, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5363381', 'n_tokens_mistral': 1440, 'n_tokens_neox': 1389, 'n_words': 365}