<commit_before><?php
namespace Bolt\Events;

use Symfony\Component\EventDispatcher\GenericEvent;

/**
 * Event instance for Storage events.
 *
 * PRE_SAVE (preSave)
 * - Available:
 *   - Content obejct
 * - Notes:
 *   - Do not call saveContent()
 *
 * POST_SAVE (postSave)
 * - Available:
 *   - Content obejct
 *   - ID
 * - Notes:
 *   - Safe to call saveContent()
 *
 * PRE_DELETE (preDelete)
 * - Available:
 *   - Content obejct
 *   - ID
 * - Notes:
 *   - Do not call saveContent()
 *
 * POST_DELETE (postDelete)
 * - Available:
 *   - Content obejct
 *   - ID
 * - Notes:
 *   - Do not call saveContent()
 *   - Database record will no longer exist
 */
class StorageEvent extends GenericEvent
{
    /**
     * @var \Bolt\Legacy\Content|array
     */
    protected $subject;

    /**
     * @var array
     */
    protected $arguments;

    /**
     * Instantiate generic Storage Event.
     *
     * @param \Bolt\Legacy\Content|array $subject   A Content object that is being saved or deleted
     * @param array                      $arguments Arguments to store in the event.
     */
    public function __construct($subject = null, array $arguments = [])
    {
        $this->subject = $subject;
        $this->arguments = $arguments;
    }

    /**
     * Return the record id.
     *
     * @return integer
     */
    public function getId()
    {
        return $this->getSubject()->id;
    }

    /**
     * Return the record contenttype.
     *
     * @return string
     */
    public function getContentType()
    {
        return $this->getSubject()->contenttype['slug'];
    }

    /**
     * Return the content object.
     *
     * @return \Bolt\Legacy\Content
     */
    public function getContent()
    {
        return $this->getSubject();
    }

    /**<commit_msg>Ensure we have a parameter to return<commit_after><?php
namespace Bolt\Events;

use Symfony\Component\EventDispatcher\GenericEvent;

/**
 * Event instance for Storage events.
 *
 * PRE_SAVE (preSave)
 * - Available:
 *   - Content obejct
 * - Notes:
 *   - Do not call saveContent()
 *
 * POST_SAVE (postSave)
 * - Available:
 *   - Content obejct
 *   - ID
 * - Notes:
 *   - Safe to call saveContent()
 *
 * PRE_DELETE (preDelete)
 * - Available:
 *   - Content obejct
 *   - ID
 * - Notes:
 *   - Do not call saveContent()
 *
 * POST_DELETE (postDelete)
 * - Available:
 *   - Content obejct
 *   - ID
 * - Notes:
 *   - Do not call saveContent()
 *   - Database record will no longer exist
 */
class StorageEvent extends GenericEvent
{
    /**
     * @var \Bolt\Legacy\Content|array
     */
    protected $subject;

    /**
     * @var array
     */
    protected $arguments;

    /**
     * Instantiate generic Storage Event.
     *
     * @param \Bolt\Legacy\Content|array $subject   A Content object that is being saved or deleted
     * @param array                      $arguments Arguments to store in the event.
     */
    public function __construct($subject = null, array $arguments = [])
    {
        $this->subject = $subject;
        $this->arguments = $arguments;
    }

    /**
     * Return the record id.
     *
     * @return integer
     */
    public function getId()
    {
        return $this->getSubject()->id;
    }

    /**
     * Return the record contenttype.
     *
     * @return string
     */
    public function getContentType()
    {
        $contentType = $this->getSubject()->contenttype;
        if ($contentType!== null && isset($contentType['slug'])) {
            return $contentType['slug'];
        }
    }

    /**
     * Return the content object.
     *
     * @return \Bolt\Legacy\Content
     */
    public function getContent()
    {
        return $this->getSubject();
    }

    /**
{'fraction_non_alphanumeric': 0.12838381131064058, 'fraction_numerical': 0.0, 'mean_word_length': 1.9689737470167064, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, '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': '1851743', 'n_tokens_mistral': 1143, 'n_tokens_neox': 1123, 'n_words': 290}